From cfa92fbd10b9c98ba920708f92c83a4e90937b7e Mon Sep 17 00:00:00 2001 From: ruowan Date: Thu, 26 Sep 2019 08:40:32 +0000 Subject: [PATCH] release azure peering service 2019-08-01 --- packages.md | 1 + sdk/peering/arm-peering/LICENSE.txt | 21 + sdk/peering/arm-peering/README.md | 103 ++ sdk/peering/arm-peering/package.json | 58 + sdk/peering/arm-peering/rollup.config.js | 37 + sdk/peering/arm-peering/src/models/index.ts | 1561 +++++++++++++++++ .../src/models/legacyPeeringsMappers.ts | 34 + sdk/peering/arm-peering/src/models/mappers.ts | 1189 +++++++++++++ .../src/models/operationsMappers.ts | 14 + .../arm-peering/src/models/parameters.ts | 135 ++ .../arm-peering/src/models/peerAsnsMappers.ts | 34 + .../src/models/peeringLocationsMappers.ts | 34 + .../models/peeringServiceLocationsMappers.ts | 34 + .../models/peeringServicePrefixesMappers.ts | 33 + .../models/peeringServiceProvidersMappers.ts | 34 + .../src/models/peeringServicesMappers.ts | 35 + .../arm-peering/src/models/peeringsMappers.ts | 35 + .../arm-peering/src/models/prefixesMappers.ts | 34 + .../arm-peering/src/operations/index.ts | 20 + .../src/operations/legacyPeerings.ts | 138 ++ .../arm-peering/src/operations/operations.ts | 123 ++ .../arm-peering/src/operations/peerAsns.ts | 296 ++++ .../src/operations/peeringLocations.ts | 132 ++ .../src/operations/peeringServiceLocations.ts | 126 ++ .../src/operations/peeringServicePrefixes.ts | 229 +++ .../src/operations/peeringServiceProviders.ts | 126 ++ .../src/operations/peeringServices.ts | 484 +++++ .../arm-peering/src/operations/peerings.ts | 484 +++++ .../arm-peering/src/operations/prefixes.ts | 136 ++ .../src/peeringManagementClient.ts | 129 ++ .../src/peeringManagementClientContext.ts | 62 + sdk/peering/arm-peering/tsconfig.json | 19 + 32 files changed, 5930 insertions(+) create mode 100644 sdk/peering/arm-peering/LICENSE.txt create mode 100644 sdk/peering/arm-peering/README.md create mode 100644 sdk/peering/arm-peering/package.json create mode 100644 sdk/peering/arm-peering/rollup.config.js create mode 100644 sdk/peering/arm-peering/src/models/index.ts create mode 100644 sdk/peering/arm-peering/src/models/legacyPeeringsMappers.ts create mode 100644 sdk/peering/arm-peering/src/models/mappers.ts create mode 100644 sdk/peering/arm-peering/src/models/operationsMappers.ts create mode 100644 sdk/peering/arm-peering/src/models/parameters.ts create mode 100644 sdk/peering/arm-peering/src/models/peerAsnsMappers.ts create mode 100644 sdk/peering/arm-peering/src/models/peeringLocationsMappers.ts create mode 100644 sdk/peering/arm-peering/src/models/peeringServiceLocationsMappers.ts create mode 100644 sdk/peering/arm-peering/src/models/peeringServicePrefixesMappers.ts create mode 100644 sdk/peering/arm-peering/src/models/peeringServiceProvidersMappers.ts create mode 100644 sdk/peering/arm-peering/src/models/peeringServicesMappers.ts create mode 100644 sdk/peering/arm-peering/src/models/peeringsMappers.ts create mode 100644 sdk/peering/arm-peering/src/models/prefixesMappers.ts create mode 100644 sdk/peering/arm-peering/src/operations/index.ts create mode 100644 sdk/peering/arm-peering/src/operations/legacyPeerings.ts create mode 100644 sdk/peering/arm-peering/src/operations/operations.ts create mode 100644 sdk/peering/arm-peering/src/operations/peerAsns.ts create mode 100644 sdk/peering/arm-peering/src/operations/peeringLocations.ts create mode 100644 sdk/peering/arm-peering/src/operations/peeringServiceLocations.ts create mode 100644 sdk/peering/arm-peering/src/operations/peeringServicePrefixes.ts create mode 100644 sdk/peering/arm-peering/src/operations/peeringServiceProviders.ts create mode 100644 sdk/peering/arm-peering/src/operations/peeringServices.ts create mode 100644 sdk/peering/arm-peering/src/operations/peerings.ts create mode 100644 sdk/peering/arm-peering/src/operations/prefixes.ts create mode 100644 sdk/peering/arm-peering/src/peeringManagementClient.ts create mode 100644 sdk/peering/arm-peering/src/peeringManagementClientContext.ts create mode 100644 sdk/peering/arm-peering/tsconfig.json diff --git a/packages.md b/packages.md index 4d58220896c9..f2f6876148e6 100644 --- a/packages.md +++ b/packages.md @@ -124,6 +124,7 @@ | [`@azure/arm-visualstudio`]( sdk/visualstudio/arm-visualstudio/package.json )| [Readme](sdk/visualstudio/arm-visualstudio/README.md) | N/A | N/A | | [`@azure/arm-webservices`]( sdk/machinelearning/arm-webservices/package.json )| [Readme](sdk/machinelearning/arm-webservices/README.md) | N/A | N/A | | [`@azure/arm-workspaces`]( sdk/machinelearning/arm-workspaces/package.json )| [Readme](sdk/machinelearning/arm-workspaces/README.md) | N/A | N/A | +| [`@azure/arm-peering`]( sdk/peering/arm-peering/package.json )| [Readme](sdk/peering/arm-peering/README.md) | N/A | N/A | | [`@azure/batch`]( sdk/batch/batch/package.json )| [Readme](sdk/batch/batch/README.md) | N/A | N/A | | [`@azure/cognitiveservices-anomalydetector`]( sdk/cognitiveservices/cognitiveservices-anomalydetector/package.json )| [Readme](sdk/cognitiveservices/cognitiveservices-anomalydetector/README.md) | N/A | N/A | | [`@azure/cognitiveservices-autosuggest`]( sdk/cognitiveservices/cognitiveservices-autosuggest/package.json )| [Readme](sdk/cognitiveservices/cognitiveservices-autosuggest/README.md) | N/A | N/A | diff --git a/sdk/peering/arm-peering/LICENSE.txt b/sdk/peering/arm-peering/LICENSE.txt new file mode 100644 index 000000000000..b73b4a1293c3 --- /dev/null +++ b/sdk/peering/arm-peering/LICENSE.txt @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2019 Microsoft + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/sdk/peering/arm-peering/README.md b/sdk/peering/arm-peering/README.md new file mode 100644 index 000000000000..9359df25c682 --- /dev/null +++ b/sdk/peering/arm-peering/README.md @@ -0,0 +1,103 @@ +## Azure PeeringManagementClient SDK for JavaScript + +This package contains an isomorphic SDK for PeeringManagementClient. + +### Currently supported environments + +- Node.js version 6.x.x or higher +- Browser JavaScript + +### How to Install + +```bash +npm install @azure/arm-peering +``` + +### How to use + +#### nodejs - Authentication, client creation and list legacyPeerings as an example written in TypeScript. + +##### Install @azure/ms-rest-nodeauth + +- Please install minimum version of `"@azure/ms-rest-nodeauth": "^3.0.0"`. +```bash +npm install @azure/ms-rest-nodeauth@"^3.0.0" +``` + +##### Sample code + +```typescript +import * as msRest from "@azure/ms-rest-js"; +import * as msRestAzure from "@azure/ms-rest-azure-js"; +import * as msRestNodeAuth from "@azure/ms-rest-nodeauth"; +import { PeeringManagementClient, PeeringManagementModels, PeeringManagementMappers } from "@azure/arm-peering"; +const subscriptionId = process.env["AZURE_SUBSCRIPTION_ID"]; + +msRestNodeAuth.interactiveLogin().then((creds) => { + const client = new PeeringManagementClient(creds, subscriptionId); + const peeringLocation = "testpeeringLocation"; + const kind = "Direct"; + client.legacyPeerings.list(peeringLocation, kind).then((result) => { + console.log("The result is:"); + console.log(result); + }); +}).catch((err) => { + console.error(err); +}); +``` + +#### browser - Authentication, client creation and list legacyPeerings as an example written in JavaScript. + +##### Install @azure/ms-rest-browserauth + +```bash +npm install @azure/ms-rest-browserauth +``` + +##### Sample code + +See https://github.com/Azure/ms-rest-browserauth to learn how to authenticate to Azure in the browser. + +- index.html +```html + + + + @azure/arm-peering sample + + + + + + + + +``` + +## Related projects + +- [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js) + +![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js/sdk/peering/arm-peering/README.png) diff --git a/sdk/peering/arm-peering/package.json b/sdk/peering/arm-peering/package.json new file mode 100644 index 000000000000..d0ceacd60a82 --- /dev/null +++ b/sdk/peering/arm-peering/package.json @@ -0,0 +1,58 @@ +{ + "name": "@azure/arm-peering", + "author": "Microsoft Corporation", + "description": "PeeringManagementClient Library with typescript type definitions for node.js and browser.", + "version": "1.0.0", + "dependencies": { + "@azure/ms-rest-azure-js": "^2.0.1", + "@azure/ms-rest-js": "^2.0.4", + "tslib": "^1.10.0" + }, + "keywords": [ + "node", + "azure", + "typescript", + "browser", + "isomorphic" + ], + "license": "MIT", + "main": "./dist/arm-peering.js", + "module": "./esm/peeringManagementClient.js", + "types": "./esm/peeringManagementClient.d.ts", + "devDependencies": { + "typescript": "^3.5.3", + "rollup": "^1.18.0", + "rollup-plugin-node-resolve": "^5.2.0", + "rollup-plugin-sourcemaps": "^0.4.2", + "uglify-js": "^3.6.0" + }, + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/peering/arm-peering", + "repository": { + "type": "git", + "url": "https://github.com/Azure/azure-sdk-for-js.git" + }, + "bugs": { + "url": "https://github.com/Azure/azure-sdk-for-js/issues" + }, + "files": [ + "dist/**/*.js", + "dist/**/*.js.map", + "dist/**/*.d.ts", + "dist/**/*.d.ts.map", + "esm/**/*.js", + "esm/**/*.js.map", + "esm/**/*.d.ts", + "esm/**/*.d.ts.map", + "src/**/*.ts", + "README.md", + "rollup.config.js", + "tsconfig.json" + ], + "scripts": { + "build": "tsc && rollup -c rollup.config.js && npm run minify", + "minify": "uglifyjs -c -m --comments --source-map \"content='./dist/arm-peering.js.map'\" -o ./dist/arm-peering.min.js ./dist/arm-peering.js", + "prepack": "npm install && npm run build" + }, + "sideEffects": false, + "autoPublish": true +} diff --git a/sdk/peering/arm-peering/rollup.config.js b/sdk/peering/arm-peering/rollup.config.js new file mode 100644 index 000000000000..6115b0630086 --- /dev/null +++ b/sdk/peering/arm-peering/rollup.config.js @@ -0,0 +1,37 @@ +import rollup from "rollup"; +import nodeResolve from "rollup-plugin-node-resolve"; +import sourcemaps from "rollup-plugin-sourcemaps"; + +/** + * @type {rollup.RollupFileOptions} + */ +const config = { + input: "./esm/peeringManagementClient.js", + external: [ + "@azure/ms-rest-js", + "@azure/ms-rest-azure-js" + ], + output: { + file: "./dist/arm-peering.js", + format: "umd", + name: "Azure.ArmPeering", + sourcemap: true, + globals: { + "@azure/ms-rest-js": "msRest", + "@azure/ms-rest-azure-js": "msRestAzure" + }, + banner: `/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */` + }, + plugins: [ + nodeResolve({ mainFields: ['module', 'main'] }), + sourcemaps() + ] +}; + +export default config; diff --git a/sdk/peering/arm-peering/src/models/index.ts b/sdk/peering/arm-peering/src/models/index.ts new file mode 100644 index 000000000000..fd1be10962e1 --- /dev/null +++ b/sdk/peering/arm-peering/src/models/index.ts @@ -0,0 +1,1561 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { BaseResource, CloudError, AzureServiceClientOptions } from "@azure/ms-rest-azure-js"; +import * as msRest from "@azure/ms-rest-js"; + +export { BaseResource, CloudError }; + +/** + * Class for CheckServiceProviderAvailabilityInput + */ +export interface CheckServiceProviderAvailabilityInput { + /** + * Gets or sets the PeeringServiceLocation + */ + peeringServiceLocation?: string; + /** + * Gets or sets the PeeringServiceProvider + */ + peeringServiceProvider?: string; +} + +/** + * The SKU that defines the tier and kind of the peering. + */ +export interface PeeringSku { + /** + * The name of the peering SKU. Possible values include: 'Basic_Exchange_Free', + * 'Basic_Direct_Free', 'Premium_Direct_Free', 'Premium_Exchange_Metered', + * 'Premium_Direct_Metered', 'Premium_Direct_Unlimited' + */ + name?: Name; + /** + * The tier of the peering SKU. Possible values include: 'Basic', 'Premium' + */ + tier?: Tier; + /** + * The family of the peering SKU. Possible values include: 'Direct', 'Exchange' + */ + family?: Family; + /** + * The size of the peering SKU. Possible values include: 'Free', 'Metered', 'Unlimited' + */ + size?: Size; +} + +/** + * The properties that define a BGP session. + */ +export interface BgpSession { + /** + * The IPv4 prefix that contains both ends' IPv4 addresses. + */ + sessionPrefixV4?: string; + /** + * The IPv6 prefix that contains both ends' IPv6 addresses. + */ + sessionPrefixV6?: string; + /** + * The IPv4 session address on Microsoft's end. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly microsoftSessionIPv4Address?: string; + /** + * The IPv6 session address on Microsoft's end. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly microsoftSessionIPv6Address?: string; + /** + * The IPv4 session address on peer's end. + */ + peerSessionIPv4Address?: string; + /** + * The IPv6 session address on peer's end. + */ + peerSessionIPv6Address?: string; + /** + * The state of the IPv4 session. Possible values include: 'None', 'Idle', 'Connect', 'Active', + * 'OpenSent', 'OpenConfirm', 'OpenReceived', 'Established', 'PendingAdd', 'PendingUpdate', + * 'PendingRemove' + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly sessionStateV4?: SessionStateV4; + /** + * The state of the IPv6 session. Possible values include: 'None', 'Idle', 'Connect', 'Active', + * 'OpenSent', 'OpenConfirm', 'OpenReceived', 'Established', 'PendingAdd', 'PendingUpdate', + * 'PendingRemove' + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly sessionStateV6?: SessionStateV6; + /** + * The maximum number of prefixes advertised over the IPv4 session. + */ + maxPrefixesAdvertisedV4?: number; + /** + * The maximum number of prefixes advertised over the IPv6 session. + */ + maxPrefixesAdvertisedV6?: number; + /** + * The MD5 authentication key of the session. + */ + md5AuthenticationKey?: string; +} + +/** + * The properties that define a direct connection. + */ +export interface DirectConnection { + /** + * The bandwidth of the connection. + */ + bandwidthInMbps?: number; + /** + * The bandwidth that is actually provisioned. + */ + provisionedBandwidthInMbps?: number; + /** + * The field indicating if Microsoft provides session ip addresses. Possible values include: + * 'Microsoft', 'Peer' + */ + sessionAddressProvider?: SessionAddressProvider; + /** + * The flag that indicates whether or not the connection is used for peering service. + */ + useForPeeringService?: boolean; + /** + * The PeeringDB.com ID of the facility at which the connection has to be set up. + */ + peeringDBFacilityId?: number; + /** + * The state of the connection. Possible values include: 'None', 'PendingApproval', 'Approved', + * 'ProvisioningStarted', 'ProvisioningFailed', 'ProvisioningCompleted', 'Validating', 'Active' + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly connectionState?: ConnectionState; + /** + * The BGP session associated with the connection. + */ + bgpSession?: BgpSession; + /** + * The unique identifier (GUID) for the connection. + */ + connectionIdentifier?: string; +} + +/** + * The sub resource. + */ +export interface SubResource { + /** + * The identifier of the referenced resource. + */ + id?: string; +} + +/** + * The properties that define a direct peering. + */ +export interface PeeringPropertiesDirect { + /** + * The set of connections that constitute a direct peering. + */ + connections?: DirectConnection[]; + /** + * The flag that indicates whether or not the peering is used for peering service. + */ + useForPeeringService?: boolean; + /** + * The reference of the peer ASN. + */ + peerAsn?: SubResource; + /** + * The type of direct peering. Possible values include: 'Edge', 'Transit', 'Cdn', 'Internal' + */ + directPeeringType?: DirectPeeringType; +} + +/** + * The properties that define an exchange connection. + */ +export interface ExchangeConnection { + /** + * The PeeringDB.com ID of the facility at which the connection has to be set up. + */ + peeringDBFacilityId?: number; + /** + * The state of the connection. Possible values include: 'None', 'PendingApproval', 'Approved', + * 'ProvisioningStarted', 'ProvisioningFailed', 'ProvisioningCompleted', 'Validating', 'Active' + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly connectionState?: ConnectionState; + /** + * The BGP session associated with the connection. + */ + bgpSession?: BgpSession; + /** + * The unique identifier (GUID) for the connection. + */ + connectionIdentifier?: string; +} + +/** + * The properties that define an exchange peering. + */ +export interface PeeringPropertiesExchange { + /** + * The set of connections that constitute an exchange peering. + */ + connections?: ExchangeConnection[]; + /** + * The reference of the peer ASN. + */ + peerAsn?: SubResource; +} + +/** + * The ARM resource class. + */ +export interface Resource extends BaseResource { + /** + * The name of the resource. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly name?: string; + /** + * The ID of the resource. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly id?: string; + /** + * The type of the resource. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly type?: string; +} + +/** + * Peering is a logical representation of a set of connections to the Microsoft Cloud Edge at a + * location. + */ +export interface Peering extends Resource { + /** + * The SKU that defines the tier and kind of the peering. + */ + sku: PeeringSku; + /** + * The kind of the peering. Possible values include: 'Direct', 'Exchange' + */ + kind: Kind; + /** + * The properties that define a direct peering. + */ + direct?: PeeringPropertiesDirect; + /** + * The properties that define an exchange peering. + */ + exchange?: PeeringPropertiesExchange; + /** + * The location of the peering. + */ + peeringLocation?: string; + /** + * The provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', + * 'Deleting', 'Failed' + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly provisioningState?: ProvisioningState; + /** + * The location of the resource. + */ + location: string; + /** + * The resource tags. + */ + tags?: { [propertyName: string]: string }; +} + +/** + * The information related to the operation. + */ +export interface OperationDisplayInfo { + /** + * The name of the resource provider. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly provider?: string; + /** + * The type of the resource. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly resource?: string; + /** + * The name of the operation. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly operation?: string; + /** + * The description of the operation. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly description?: string; +} + +/** + * The peering API operation. + */ +export interface Operation { + /** + * The name of the operation. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly name?: string; + /** + * The information related to the operation. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly display?: OperationDisplayInfo; + /** + * The flag that indicates whether the operation applies to data plane. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly isDataAction?: boolean; +} + +/** + * The contact information of the peer. + */ +export interface ContactInfo { + /** + * The list of email addresses. + */ + emails?: string[]; + /** + * The list of contact numbers. + */ + phone?: string[]; +} + +/** + * The essential information related to the peer's ASN. + */ +export interface PeerAsn extends Resource { + /** + * The Autonomous System Number (ASN) of the peer. + */ + peerAsn?: number; + /** + * The contact information of the peer. + */ + peerContactInfo?: ContactInfo; + /** + * The name of the peer. + */ + peerName?: string; + /** + * The validation state of the ASN associated with the peer. Possible values include: 'None', + * 'Pending', 'Approved', 'Failed' + */ + validationState?: ValidationState; +} + +/** + * The properties that define a direct peering facility. + */ +export interface DirectPeeringFacility { + /** + * The address of the direct peering facility. + */ + address?: string; + /** + * The type of the direct peering. Possible values include: 'Edge', 'Transit', 'Cdn', 'Internal' + */ + directPeeringType?: DirectPeeringType; + /** + * The PeeringDB.com ID of the facility. + */ + peeringDBFacilityId?: number; + /** + * The PeeringDB.com URL of the facility. + */ + peeringDBFacilityLink?: string; +} + +/** + * The properties that define a peering bandwidth offer. + */ +export interface PeeringBandwidthOffer { + /** + * The name of the bandwidth offer. + */ + offerName?: string; + /** + * The value of the bandwidth offer in Mbps. + */ + valueInMbps?: number; +} + +/** + * The properties that define a direct peering location. + */ +export interface PeeringLocationPropertiesDirect { + /** + * The list of direct peering facilities at the peering location. + */ + peeringFacilities?: DirectPeeringFacility[]; + /** + * The list of bandwidth offers available at the peering location. + */ + bandwidthOffers?: PeeringBandwidthOffer[]; +} + +/** + * The properties that define an exchange peering facility. + */ +export interface ExchangePeeringFacility { + /** + * The name of the exchange peering facility. + */ + exchangeName?: string; + /** + * The bandwidth of the connection between Microsoft and the exchange peering facility. + */ + bandwidthInMbps?: number; + /** + * The IPv4 address of Microsoft at the exchange peering facility. + */ + microsoftIPv4Address?: string; + /** + * The IPv6 address of Microsoft at the exchange peering facility. + */ + microsoftIPv6Address?: string; + /** + * The IPv4 prefixes associated with the exchange peering facility. + */ + facilityIPv4Prefix?: string; + /** + * The IPv6 prefixes associated with the exchange peering facility. + */ + facilityIPv6Prefix?: string; + /** + * The PeeringDB.com ID of the facility. + */ + peeringDBFacilityId?: number; + /** + * The PeeringDB.com URL of the facility. + */ + peeringDBFacilityLink?: string; +} + +/** + * The properties that define an exchange peering location. + */ +export interface PeeringLocationPropertiesExchange { + /** + * The list of exchange peering facilities at the peering location. + */ + peeringFacilities?: ExchangePeeringFacility[]; +} + +/** + * Peering location is where connectivity could be established to the Microsoft Cloud Edge. + */ +export interface PeeringLocation extends Resource { + /** + * The kind of peering that the peering location supports. Possible values include: 'Direct', + * 'Exchange' + */ + kind?: Kind; + /** + * The properties that define a direct peering location. + */ + direct?: PeeringLocationPropertiesDirect; + /** + * The properties that define an exchange peering location. + */ + exchange?: PeeringLocationPropertiesExchange; + /** + * The name of the peering location. + */ + peeringLocation?: string; + /** + * The country in which the peering location exists. + */ + country?: string; + /** + * The Azure region associated with the peering location. + */ + azureRegion?: string; +} + +/** + * The resource tags. + */ +export interface ResourceTags { + /** + * Gets or sets the tags, a dictionary of descriptors arm object + */ + tags?: { [propertyName: string]: string }; +} + +/** + * PeeringService location + */ +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 interface PeeringServicePrefix extends Resource { + /** + * Valid route prefix + */ + prefix?: string; + /** + * The prefix validation state. Possible values include: 'None', 'Invalid', 'Verified', 'Failed', + * 'Pending', 'Unknown' + */ + prefixValidationState?: PrefixValidationState; + /** + * The prefix learned type. Possible values include: 'None', 'ViaPartner', 'ViaSession' + */ + learnedType?: LearnedType; + /** + * The provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', + * 'Deleting', 'Failed' + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly provisioningState?: ProvisioningState; +} + +/** + * PeeringService provider + */ +export interface PeeringServiceProvider extends Resource { + /** + * The name of the service provider. + */ + serviceProviderName?: string; +} + +/** + * Peering Service + */ +export interface PeeringService extends Resource { + /** + * The PeeringServiceLocation of the Customer. + */ + peeringServiceLocation?: string; + /** + * The MAPS Provider Name. + */ + peeringServiceProvider?: string; + /** + * The provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', + * 'Deleting', 'Failed' + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly provisioningState?: ProvisioningState; + /** + * The location of the resource. + */ + location: string; + /** + * The resource tags. + */ + tags?: { [propertyName: string]: string }; +} + +/** + * The error response that indicates why an operation has failed. + */ +export interface ErrorResponse { + /** + * The error code. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly code?: string; + /** + * The error message. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly message?: string; +} + +/** + * Optional Parameters. + */ +export interface PeeringManagementClientCheckServiceProviderAvailabilityOptionalParams extends msRest.RequestOptionsBase { + /** + * Gets or sets the PeeringServiceLocation + */ + peeringServiceLocation?: string; + /** + * Gets or sets the PeeringServiceProvider + */ + peeringServiceProvider?: string; +} + +/** + * Optional Parameters. + */ +export interface PeeringLocationsListOptionalParams extends msRest.RequestOptionsBase { + /** + * The type of direct peering. Possible values include: 'Edge', 'Transit', 'Cdn', 'Internal' + */ + directPeeringType?: DirectPeeringType1; +} + +/** + * Optional Parameters. + */ +export interface PeeringsUpdateOptionalParams extends msRest.RequestOptionsBase { + /** + * Gets or sets the tags, a dictionary of descriptors arm object + */ + tags?: { [propertyName: string]: string }; +} + +/** + * Optional Parameters. + */ +export interface PeeringServicesUpdateOptionalParams extends msRest.RequestOptionsBase { + /** + * Gets or sets the tags, a dictionary of descriptors arm object + */ + tags?: { [propertyName: string]: string }; +} + +/** + * An interface representing PeeringManagementClientOptions. + */ +export interface PeeringManagementClientOptions extends AzureServiceClientOptions { + baseUri?: string; +} + +/** + * @interface + * The paginated list of peerings. + * @extends Array + */ +export interface PeeringListResult extends Array { + /** + * The link to fetch the next page of peerings. + */ + nextLink?: string; +} + +/** + * @interface + * The paginated list of peering API operations. + * @extends Array + */ +export interface OperationListResult extends Array { + /** + * The link to fetch the next page of peering API operations. + */ + nextLink?: string; +} + +/** + * @interface + * The paginated list of peer ASNs. + * @extends Array + */ +export interface PeerAsnListResult extends Array { + /** + * The link to fetch the next page of peer ASNs. + */ + nextLink?: string; +} + +/** + * @interface + * The paginated list of peering locations. + * @extends Array + */ +export interface PeeringLocationListResult extends Array { + /** + * The link to fetch the next page of peering locations. + */ + nextLink?: string; +} + +/** + * @interface + * The paginated list of peering service locations. + * @extends Array + */ +export interface PeeringServiceLocationListResult extends Array { + /** + * The link to fetch the next page of peering service locations. + */ + nextLink?: string; +} + +/** + * @interface + * The paginated list of [T]. + * @extends Array + */ +export interface PeeringServicePrefixListResult extends Array { + /** + * The link to fetch the next page of [T]. + */ + nextLink?: string; +} + +/** + * @interface + * The paginated list of peering service providers. + * @extends Array + */ +export interface PeeringServiceProviderListResult extends Array { + /** + * The link to fetch the next page of peering service providers. + */ + nextLink?: string; +} + +/** + * @interface + * The paginated list of peering services. + * @extends Array + */ +export interface PeeringServiceListResult extends Array { + /** + * The link to fetch the next page of peering services. + */ + nextLink?: string; +} + +/** + * Defines values for Name. + * Possible values include: 'Basic_Exchange_Free', 'Basic_Direct_Free', 'Premium_Direct_Free', + * 'Premium_Exchange_Metered', 'Premium_Direct_Metered', 'Premium_Direct_Unlimited' + * @readonly + * @enum {string} + */ +export type Name = 'Basic_Exchange_Free' | 'Basic_Direct_Free' | 'Premium_Direct_Free' | 'Premium_Exchange_Metered' | 'Premium_Direct_Metered' | 'Premium_Direct_Unlimited'; + +/** + * Defines values for Tier. + * Possible values include: 'Basic', 'Premium' + * @readonly + * @enum {string} + */ +export type Tier = 'Basic' | 'Premium'; + +/** + * Defines values for Family. + * Possible values include: 'Direct', 'Exchange' + * @readonly + * @enum {string} + */ +export type Family = 'Direct' | 'Exchange'; + +/** + * Defines values for Size. + * Possible values include: 'Free', 'Metered', 'Unlimited' + * @readonly + * @enum {string} + */ +export type Size = 'Free' | 'Metered' | 'Unlimited'; + +/** + * Defines values for Kind. + * Possible values include: 'Direct', 'Exchange' + * @readonly + * @enum {string} + */ +export type Kind = 'Direct' | 'Exchange'; + +/** + * Defines values for SessionAddressProvider. + * Possible values include: 'Microsoft', 'Peer' + * @readonly + * @enum {string} + */ +export type SessionAddressProvider = 'Microsoft' | 'Peer'; + +/** + * Defines values for ConnectionState. + * Possible values include: 'None', 'PendingApproval', 'Approved', 'ProvisioningStarted', + * 'ProvisioningFailed', 'ProvisioningCompleted', 'Validating', 'Active' + * @readonly + * @enum {string} + */ +export type ConnectionState = 'None' | 'PendingApproval' | 'Approved' | 'ProvisioningStarted' | 'ProvisioningFailed' | 'ProvisioningCompleted' | 'Validating' | 'Active'; + +/** + * Defines values for SessionStateV4. + * Possible values include: 'None', 'Idle', 'Connect', 'Active', 'OpenSent', 'OpenConfirm', + * 'OpenReceived', 'Established', 'PendingAdd', 'PendingUpdate', 'PendingRemove' + * @readonly + * @enum {string} + */ +export type SessionStateV4 = 'None' | 'Idle' | 'Connect' | 'Active' | 'OpenSent' | 'OpenConfirm' | 'OpenReceived' | 'Established' | 'PendingAdd' | 'PendingUpdate' | 'PendingRemove'; + +/** + * Defines values for SessionStateV6. + * Possible values include: 'None', 'Idle', 'Connect', 'Active', 'OpenSent', 'OpenConfirm', + * 'OpenReceived', 'Established', 'PendingAdd', 'PendingUpdate', 'PendingRemove' + * @readonly + * @enum {string} + */ +export type SessionStateV6 = 'None' | 'Idle' | 'Connect' | 'Active' | 'OpenSent' | 'OpenConfirm' | 'OpenReceived' | 'Established' | 'PendingAdd' | 'PendingUpdate' | 'PendingRemove'; + +/** + * Defines values for DirectPeeringType. + * Possible values include: 'Edge', 'Transit', 'Cdn', 'Internal' + * @readonly + * @enum {string} + */ +export type DirectPeeringType = 'Edge' | 'Transit' | 'Cdn' | 'Internal'; + +/** + * Defines values for ProvisioningState. + * Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + * @readonly + * @enum {string} + */ +export type ProvisioningState = 'Succeeded' | 'Updating' | 'Deleting' | 'Failed'; + +/** + * Defines values for ValidationState. + * Possible values include: 'None', 'Pending', 'Approved', 'Failed' + * @readonly + * @enum {string} + */ +export type ValidationState = 'None' | 'Pending' | 'Approved' | 'Failed'; + +/** + * Defines values for PrefixValidationState. + * Possible values include: 'None', 'Invalid', 'Verified', 'Failed', 'Pending', 'Unknown' + * @readonly + * @enum {string} + */ +export type PrefixValidationState = 'None' | 'Invalid' | 'Verified' | 'Failed' | 'Pending' | 'Unknown'; + +/** + * Defines values for LearnedType. + * Possible values include: 'None', 'ViaPartner', 'ViaSession' + * @readonly + * @enum {string} + */ +export type LearnedType = 'None' | 'ViaPartner' | 'ViaSession'; + +/** + * Defines values for DirectPeeringType1. + * Possible values include: 'Edge', 'Transit', 'Cdn', 'Internal' + * @readonly + * @enum {string} + */ +export type DirectPeeringType1 = 'Edge' | 'Transit' | 'Cdn' | 'Internal'; + +/** + * Defines values for CheckServiceProviderAvailabilityOKResponse. + * Possible values include: 'Available', 'UnAvailable' + * @readonly + * @enum {string} + */ +export type CheckServiceProviderAvailabilityOKResponse = 'Available' | 'UnAvailable'; + +/** + * Defines values for Kind1. + * Possible values include: 'Direct', 'Exchange' + * @readonly + * @enum {string} + */ +export type Kind1 = 'Direct' | 'Exchange'; + +/** + * Defines values for Kind2. + * Possible values include: 'Direct', 'Exchange' + * @readonly + * @enum {string} + */ +export type Kind2 = 'Direct' | 'Exchange'; + +/** + * Contains response data for the checkServiceProviderAvailability operation. + */ +export type CheckServiceProviderAvailabilityResponse = { + /** + * The parsed response body. + */ + body: CheckServiceProviderAvailabilityOKResponse; + + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: CheckServiceProviderAvailabilityOKResponse; + }; +}; + +/** + * Contains response data for the list operation. + */ +export type LegacyPeeringsListResponse = PeeringListResult & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: PeeringListResult; + }; +}; + +/** + * Contains response data for the listNext operation. + */ +export type LegacyPeeringsListNextResponse = PeeringListResult & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: PeeringListResult; + }; +}; + +/** + * Contains response data for the list operation. + */ +export type OperationsListResponse = OperationListResult & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: OperationListResult; + }; +}; + +/** + * Contains response data for the listNext operation. + */ +export type OperationsListNextResponse = OperationListResult & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: OperationListResult; + }; +}; + +/** + * Contains response data for the get operation. + */ +export type PeerAsnsGetResponse = PeerAsn & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: PeerAsn; + }; +}; + +/** + * Contains response data for the createOrUpdate operation. + */ +export type PeerAsnsCreateOrUpdateResponse = PeerAsn & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: PeerAsn; + }; +}; + +/** + * Contains response data for the listBySubscription operation. + */ +export type PeerAsnsListBySubscriptionResponse = PeerAsnListResult & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: PeerAsnListResult; + }; +}; + +/** + * Contains response data for the listBySubscriptionNext operation. + */ +export type PeerAsnsListBySubscriptionNextResponse = PeerAsnListResult & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: PeerAsnListResult; + }; +}; + +/** + * Contains response data for the list operation. + */ +export type PeeringLocationsListResponse = PeeringLocationListResult & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: PeeringLocationListResult; + }; +}; + +/** + * Contains response data for the listNext operation. + */ +export type PeeringLocationsListNextResponse = PeeringLocationListResult & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: PeeringLocationListResult; + }; +}; + +/** + * Contains response data for the get operation. + */ +export type PeeringsGetResponse = Peering & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: Peering; + }; +}; + +/** + * Contains response data for the createOrUpdate operation. + */ +export type PeeringsCreateOrUpdateResponse = Peering & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: Peering; + }; +}; + +/** + * Contains response data for the update operation. + */ +export type PeeringsUpdateResponse = Peering & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: Peering; + }; +}; + +/** + * Contains response data for the listByResourceGroup operation. + */ +export type PeeringsListByResourceGroupResponse = PeeringListResult & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: PeeringListResult; + }; +}; + +/** + * Contains response data for the listBySubscription operation. + */ +export type PeeringsListBySubscriptionResponse = PeeringListResult & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: PeeringListResult; + }; +}; + +/** + * Contains response data for the listByResourceGroupNext operation. + */ +export type PeeringsListByResourceGroupNextResponse = PeeringListResult & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: PeeringListResult; + }; +}; + +/** + * Contains response data for the listBySubscriptionNext operation. + */ +export type PeeringsListBySubscriptionNextResponse = PeeringListResult & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: PeeringListResult; + }; +}; + +/** + * Contains response data for the list operation. + */ +export type PeeringServiceLocationsListResponse = PeeringServiceLocationListResult & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: PeeringServiceLocationListResult; + }; +}; + +/** + * Contains response data for the listNext operation. + */ +export type PeeringServiceLocationsListNextResponse = PeeringServiceLocationListResult & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: PeeringServiceLocationListResult; + }; +}; + +/** + * Contains response data for the get operation. + */ +export type PeeringServicePrefixesGetResponse = PeeringServicePrefix & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: PeeringServicePrefix; + }; +}; + +/** + * Contains response data for the createOrUpdate operation. + */ +export type PeeringServicePrefixesCreateOrUpdateResponse = PeeringServicePrefix & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: PeeringServicePrefix; + }; +}; + +/** + * Contains response data for the listByPeeringService operation. + */ +export type PrefixesListByPeeringServiceResponse = PeeringServicePrefixListResult & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: PeeringServicePrefixListResult; + }; +}; + +/** + * Contains response data for the listByPeeringServiceNext operation. + */ +export type PrefixesListByPeeringServiceNextResponse = PeeringServicePrefixListResult & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: PeeringServicePrefixListResult; + }; +}; + +/** + * Contains response data for the list operation. + */ +export type PeeringServiceProvidersListResponse = PeeringServiceProviderListResult & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: PeeringServiceProviderListResult; + }; +}; + +/** + * Contains response data for the listNext operation. + */ +export type PeeringServiceProvidersListNextResponse = PeeringServiceProviderListResult & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: PeeringServiceProviderListResult; + }; +}; + +/** + * Contains response data for the get operation. + */ +export type PeeringServicesGetResponse = PeeringService & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: PeeringService; + }; +}; + +/** + * Contains response data for the createOrUpdate operation. + */ +export type PeeringServicesCreateOrUpdateResponse = PeeringService & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: PeeringService; + }; +}; + +/** + * Contains response data for the update operation. + */ +export type PeeringServicesUpdateResponse = PeeringService & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: PeeringService; + }; +}; + +/** + * Contains response data for the listByResourceGroup operation. + */ +export type PeeringServicesListByResourceGroupResponse = PeeringServiceListResult & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: PeeringServiceListResult; + }; +}; + +/** + * Contains response data for the listBySubscription operation. + */ +export type PeeringServicesListBySubscriptionResponse = PeeringServiceListResult & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: PeeringServiceListResult; + }; +}; + +/** + * Contains response data for the listByResourceGroupNext operation. + */ +export type PeeringServicesListByResourceGroupNextResponse = PeeringServiceListResult & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: PeeringServiceListResult; + }; +}; + +/** + * Contains response data for the listBySubscriptionNext operation. + */ +export type PeeringServicesListBySubscriptionNextResponse = PeeringServiceListResult & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: PeeringServiceListResult; + }; +}; diff --git a/sdk/peering/arm-peering/src/models/legacyPeeringsMappers.ts b/sdk/peering/arm-peering/src/models/legacyPeeringsMappers.ts new file mode 100644 index 000000000000..147e9d528f40 --- /dev/null +++ b/sdk/peering/arm-peering/src/models/legacyPeeringsMappers.ts @@ -0,0 +1,34 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +export { + BaseResource, + BgpSession, + ContactInfo, + DirectConnection, + DirectPeeringFacility, + ErrorResponse, + ExchangeConnection, + ExchangePeeringFacility, + PeerAsn, + Peering, + PeeringBandwidthOffer, + PeeringListResult, + PeeringLocation, + PeeringLocationPropertiesDirect, + PeeringLocationPropertiesExchange, + PeeringPropertiesDirect, + PeeringPropertiesExchange, + PeeringService, + PeeringServiceLocation, + PeeringServicePrefix, + PeeringServiceProvider, + PeeringSku, + Resource, + SubResource +} from "../models/mappers"; diff --git a/sdk/peering/arm-peering/src/models/mappers.ts b/sdk/peering/arm-peering/src/models/mappers.ts new file mode 100644 index 000000000000..534d6d8012e8 --- /dev/null +++ b/sdk/peering/arm-peering/src/models/mappers.ts @@ -0,0 +1,1189 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { CloudErrorMapper, BaseResourceMapper } from "@azure/ms-rest-azure-js"; +import * as msRest from "@azure/ms-rest-js"; + +export const CloudError = CloudErrorMapper; +export const BaseResource = BaseResourceMapper; + +export const CheckServiceProviderAvailabilityInput: msRest.CompositeMapper = { + serializedName: "CheckServiceProviderAvailabilityInput", + type: { + name: "Composite", + className: "CheckServiceProviderAvailabilityInput", + modelProperties: { + peeringServiceLocation: { + serializedName: "peeringServiceLocation", + type: { + name: "String" + } + }, + peeringServiceProvider: { + serializedName: "peeringServiceProvider", + type: { + name: "String" + } + } + } + } +}; + +export const PeeringSku: msRest.CompositeMapper = { + serializedName: "PeeringSku", + type: { + name: "Composite", + className: "PeeringSku", + modelProperties: { + name: { + serializedName: "name", + type: { + name: "String" + } + }, + tier: { + serializedName: "tier", + type: { + name: "String" + } + }, + family: { + serializedName: "family", + type: { + name: "String" + } + }, + size: { + serializedName: "size", + type: { + name: "String" + } + } + } + } +}; + +export const BgpSession: msRest.CompositeMapper = { + serializedName: "BgpSession", + type: { + name: "Composite", + className: "BgpSession", + modelProperties: { + sessionPrefixV4: { + serializedName: "sessionPrefixV4", + type: { + name: "String" + } + }, + sessionPrefixV6: { + serializedName: "sessionPrefixV6", + type: { + name: "String" + } + }, + microsoftSessionIPv4Address: { + readOnly: true, + serializedName: "microsoftSessionIPv4Address", + type: { + name: "String" + } + }, + microsoftSessionIPv6Address: { + readOnly: true, + serializedName: "microsoftSessionIPv6Address", + type: { + name: "String" + } + }, + peerSessionIPv4Address: { + serializedName: "peerSessionIPv4Address", + type: { + name: "String" + } + }, + peerSessionIPv6Address: { + serializedName: "peerSessionIPv6Address", + type: { + name: "String" + } + }, + sessionStateV4: { + readOnly: true, + serializedName: "sessionStateV4", + type: { + name: "String" + } + }, + sessionStateV6: { + readOnly: true, + serializedName: "sessionStateV6", + type: { + name: "String" + } + }, + maxPrefixesAdvertisedV4: { + serializedName: "maxPrefixesAdvertisedV4", + type: { + name: "Number" + } + }, + maxPrefixesAdvertisedV6: { + serializedName: "maxPrefixesAdvertisedV6", + type: { + name: "Number" + } + }, + md5AuthenticationKey: { + serializedName: "md5AuthenticationKey", + type: { + name: "String" + } + } + } + } +}; + +export const DirectConnection: msRest.CompositeMapper = { + serializedName: "DirectConnection", + type: { + name: "Composite", + className: "DirectConnection", + modelProperties: { + bandwidthInMbps: { + serializedName: "bandwidthInMbps", + type: { + name: "Number" + } + }, + provisionedBandwidthInMbps: { + serializedName: "provisionedBandwidthInMbps", + type: { + name: "Number" + } + }, + sessionAddressProvider: { + serializedName: "sessionAddressProvider", + type: { + name: "String" + } + }, + useForPeeringService: { + serializedName: "useForPeeringService", + type: { + name: "Boolean" + } + }, + peeringDBFacilityId: { + serializedName: "peeringDBFacilityId", + type: { + name: "Number" + } + }, + connectionState: { + readOnly: true, + serializedName: "connectionState", + type: { + name: "String" + } + }, + bgpSession: { + serializedName: "bgpSession", + type: { + name: "Composite", + className: "BgpSession" + } + }, + connectionIdentifier: { + serializedName: "connectionIdentifier", + type: { + name: "String" + } + } + } + } +}; + +export const SubResource: msRest.CompositeMapper = { + serializedName: "SubResource", + type: { + name: "Composite", + className: "SubResource", + modelProperties: { + id: { + serializedName: "id", + type: { + name: "String" + } + } + } + } +}; + +export const PeeringPropertiesDirect: msRest.CompositeMapper = { + serializedName: "PeeringPropertiesDirect", + type: { + name: "Composite", + className: "PeeringPropertiesDirect", + modelProperties: { + connections: { + serializedName: "connections", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "DirectConnection" + } + } + } + }, + useForPeeringService: { + serializedName: "useForPeeringService", + type: { + name: "Boolean" + } + }, + peerAsn: { + serializedName: "peerAsn", + type: { + name: "Composite", + className: "SubResource" + } + }, + directPeeringType: { + serializedName: "directPeeringType", + type: { + name: "String" + } + } + } + } +}; + +export const ExchangeConnection: msRest.CompositeMapper = { + serializedName: "ExchangeConnection", + type: { + name: "Composite", + className: "ExchangeConnection", + modelProperties: { + peeringDBFacilityId: { + serializedName: "peeringDBFacilityId", + type: { + name: "Number" + } + }, + connectionState: { + readOnly: true, + serializedName: "connectionState", + type: { + name: "String" + } + }, + bgpSession: { + serializedName: "bgpSession", + type: { + name: "Composite", + className: "BgpSession" + } + }, + connectionIdentifier: { + serializedName: "connectionIdentifier", + type: { + name: "String" + } + } + } + } +}; + +export const PeeringPropertiesExchange: msRest.CompositeMapper = { + serializedName: "PeeringPropertiesExchange", + type: { + name: "Composite", + className: "PeeringPropertiesExchange", + modelProperties: { + connections: { + serializedName: "connections", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ExchangeConnection" + } + } + } + }, + peerAsn: { + serializedName: "peerAsn", + type: { + name: "Composite", + className: "SubResource" + } + } + } + } +}; + +export const Resource: msRest.CompositeMapper = { + serializedName: "Resource", + type: { + name: "Composite", + className: "Resource", + modelProperties: { + name: { + readOnly: true, + serializedName: "name", + type: { + name: "String" + } + }, + id: { + readOnly: true, + serializedName: "id", + type: { + name: "String" + } + }, + type: { + readOnly: true, + serializedName: "type", + type: { + name: "String" + } + } + } + } +}; + +export const Peering: msRest.CompositeMapper = { + serializedName: "Peering", + type: { + name: "Composite", + className: "Peering", + modelProperties: { + ...Resource.type.modelProperties, + sku: { + required: true, + serializedName: "sku", + type: { + name: "Composite", + className: "PeeringSku" + } + }, + kind: { + required: true, + serializedName: "kind", + type: { + name: "String" + } + }, + direct: { + serializedName: "properties.direct", + type: { + name: "Composite", + className: "PeeringPropertiesDirect" + } + }, + exchange: { + serializedName: "properties.exchange", + type: { + name: "Composite", + className: "PeeringPropertiesExchange" + } + }, + peeringLocation: { + serializedName: "properties.peeringLocation", + type: { + name: "String" + } + }, + provisioningState: { + readOnly: true, + serializedName: "properties.provisioningState", + type: { + name: "String" + } + }, + location: { + required: true, + serializedName: "location", + type: { + name: "String" + } + }, + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { + type: { + name: "String" + } + } + } + } + } + } +}; + +export const OperationDisplayInfo: msRest.CompositeMapper = { + serializedName: "OperationDisplayInfo", + type: { + name: "Composite", + className: "OperationDisplayInfo", + modelProperties: { + provider: { + readOnly: true, + serializedName: "provider", + type: { + name: "String" + } + }, + resource: { + readOnly: true, + serializedName: "resource", + type: { + name: "String" + } + }, + operation: { + readOnly: true, + serializedName: "operation", + type: { + name: "String" + } + }, + description: { + readOnly: true, + serializedName: "description", + type: { + name: "String" + } + } + } + } +}; + +export const Operation: msRest.CompositeMapper = { + serializedName: "Operation", + type: { + name: "Composite", + className: "Operation", + modelProperties: { + name: { + readOnly: true, + serializedName: "name", + type: { + name: "String" + } + }, + display: { + readOnly: true, + serializedName: "display", + type: { + name: "Composite", + className: "OperationDisplayInfo" + } + }, + isDataAction: { + readOnly: true, + serializedName: "isDataAction", + type: { + name: "Boolean" + } + } + } + } +}; + +export const ContactInfo: msRest.CompositeMapper = { + serializedName: "ContactInfo", + type: { + name: "Composite", + className: "ContactInfo", + modelProperties: { + emails: { + serializedName: "emails", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + phone: { + serializedName: "phone", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + } + } + } +}; + +export const PeerAsn: msRest.CompositeMapper = { + serializedName: "PeerAsn", + type: { + name: "Composite", + className: "PeerAsn", + modelProperties: { + ...Resource.type.modelProperties, + peerAsn: { + serializedName: "properties.peerAsn", + type: { + name: "Number" + } + }, + peerContactInfo: { + serializedName: "properties.peerContactInfo", + type: { + name: "Composite", + className: "ContactInfo" + } + }, + peerName: { + serializedName: "properties.peerName", + type: { + name: "String" + } + }, + validationState: { + serializedName: "properties.validationState", + type: { + name: "String" + } + } + } + } +}; + +export const DirectPeeringFacility: msRest.CompositeMapper = { + serializedName: "DirectPeeringFacility", + type: { + name: "Composite", + className: "DirectPeeringFacility", + modelProperties: { + address: { + serializedName: "address", + type: { + name: "String" + } + }, + directPeeringType: { + serializedName: "directPeeringType", + type: { + name: "String" + } + }, + peeringDBFacilityId: { + serializedName: "peeringDBFacilityId", + type: { + name: "Number" + } + }, + peeringDBFacilityLink: { + serializedName: "peeringDBFacilityLink", + type: { + name: "String" + } + } + } + } +}; + +export const PeeringBandwidthOffer: msRest.CompositeMapper = { + serializedName: "PeeringBandwidthOffer", + type: { + name: "Composite", + className: "PeeringBandwidthOffer", + modelProperties: { + offerName: { + serializedName: "offerName", + type: { + name: "String" + } + }, + valueInMbps: { + serializedName: "valueInMbps", + type: { + name: "Number" + } + } + } + } +}; + +export const PeeringLocationPropertiesDirect: msRest.CompositeMapper = { + serializedName: "PeeringLocationPropertiesDirect", + type: { + name: "Composite", + className: "PeeringLocationPropertiesDirect", + modelProperties: { + peeringFacilities: { + serializedName: "peeringFacilities", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "DirectPeeringFacility" + } + } + } + }, + bandwidthOffers: { + serializedName: "bandwidthOffers", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "PeeringBandwidthOffer" + } + } + } + } + } + } +}; + +export const ExchangePeeringFacility: msRest.CompositeMapper = { + serializedName: "ExchangePeeringFacility", + type: { + name: "Composite", + className: "ExchangePeeringFacility", + modelProperties: { + exchangeName: { + serializedName: "exchangeName", + type: { + name: "String" + } + }, + bandwidthInMbps: { + serializedName: "bandwidthInMbps", + type: { + name: "Number" + } + }, + microsoftIPv4Address: { + serializedName: "microsoftIPv4Address", + type: { + name: "String" + } + }, + microsoftIPv6Address: { + serializedName: "microsoftIPv6Address", + type: { + name: "String" + } + }, + facilityIPv4Prefix: { + serializedName: "facilityIPv4Prefix", + type: { + name: "String" + } + }, + facilityIPv6Prefix: { + serializedName: "facilityIPv6Prefix", + type: { + name: "String" + } + }, + peeringDBFacilityId: { + serializedName: "peeringDBFacilityId", + type: { + name: "Number" + } + }, + peeringDBFacilityLink: { + serializedName: "peeringDBFacilityLink", + type: { + name: "String" + } + } + } + } +}; + +export const PeeringLocationPropertiesExchange: msRest.CompositeMapper = { + serializedName: "PeeringLocationPropertiesExchange", + type: { + name: "Composite", + className: "PeeringLocationPropertiesExchange", + modelProperties: { + peeringFacilities: { + serializedName: "peeringFacilities", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ExchangePeeringFacility" + } + } + } + } + } + } +}; + +export const PeeringLocation: msRest.CompositeMapper = { + serializedName: "PeeringLocation", + type: { + name: "Composite", + className: "PeeringLocation", + modelProperties: { + ...Resource.type.modelProperties, + kind: { + serializedName: "kind", + type: { + name: "String" + } + }, + direct: { + serializedName: "properties.direct", + type: { + name: "Composite", + className: "PeeringLocationPropertiesDirect" + } + }, + exchange: { + serializedName: "properties.exchange", + type: { + name: "Composite", + className: "PeeringLocationPropertiesExchange" + } + }, + peeringLocation: { + serializedName: "properties.peeringLocation", + type: { + name: "String" + } + }, + country: { + serializedName: "properties.country", + type: { + name: "String" + } + }, + azureRegion: { + serializedName: "properties.azureRegion", + type: { + name: "String" + } + } + } + } +}; + +export const ResourceTags: msRest.CompositeMapper = { + serializedName: "ResourceTags", + type: { + name: "Composite", + className: "ResourceTags", + modelProperties: { + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { + type: { + name: "String" + } + } + } + } + } + } +}; + +export const PeeringServiceLocation: msRest.CompositeMapper = { + serializedName: "PeeringServiceLocation", + type: { + name: "Composite", + className: "PeeringServiceLocation", + modelProperties: { + ...Resource.type.modelProperties, + country: { + serializedName: "properties.country", + type: { + name: "String" + } + }, + state: { + serializedName: "properties.state", + type: { + name: "String" + } + }, + azureRegion: { + serializedName: "properties.azureRegion", + type: { + name: "String" + } + } + } + } +}; + +export const PeeringServicePrefix: msRest.CompositeMapper = { + serializedName: "PeeringServicePrefix", + type: { + name: "Composite", + className: "PeeringServicePrefix", + modelProperties: { + ...Resource.type.modelProperties, + prefix: { + serializedName: "properties.prefix", + type: { + name: "String" + } + }, + prefixValidationState: { + serializedName: "properties.prefixValidationState", + type: { + name: "String" + } + }, + learnedType: { + serializedName: "properties.learnedType", + type: { + name: "String" + } + }, + provisioningState: { + readOnly: true, + serializedName: "properties.provisioningState", + type: { + name: "String" + } + } + } + } +}; + +export const PeeringServiceProvider: msRest.CompositeMapper = { + serializedName: "PeeringServiceProvider", + type: { + name: "Composite", + className: "PeeringServiceProvider", + modelProperties: { + ...Resource.type.modelProperties, + serviceProviderName: { + serializedName: "properties.serviceProviderName", + type: { + name: "String" + } + } + } + } +}; + +export const PeeringService: msRest.CompositeMapper = { + serializedName: "PeeringService", + type: { + name: "Composite", + className: "PeeringService", + modelProperties: { + ...Resource.type.modelProperties, + peeringServiceLocation: { + serializedName: "properties.peeringServiceLocation", + type: { + name: "String" + } + }, + peeringServiceProvider: { + serializedName: "properties.peeringServiceProvider", + type: { + name: "String" + } + }, + provisioningState: { + readOnly: true, + serializedName: "properties.provisioningState", + type: { + name: "String" + } + }, + location: { + required: true, + serializedName: "location", + type: { + name: "String" + } + }, + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { + type: { + name: "String" + } + } + } + } + } + } +}; + +export const ErrorResponse: msRest.CompositeMapper = { + serializedName: "ErrorResponse", + type: { + name: "Composite", + className: "ErrorResponse", + modelProperties: { + code: { + readOnly: true, + serializedName: "code", + type: { + name: "String" + } + }, + message: { + readOnly: true, + serializedName: "message", + type: { + name: "String" + } + } + } + } +}; + +export const PeeringListResult: msRest.CompositeMapper = { + serializedName: "PeeringListResult", + type: { + name: "Composite", + className: "PeeringListResult", + modelProperties: { + value: { + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Peering" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const OperationListResult: msRest.CompositeMapper = { + serializedName: "OperationListResult", + type: { + name: "Composite", + className: "OperationListResult", + modelProperties: { + value: { + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Operation" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const PeerAsnListResult: msRest.CompositeMapper = { + serializedName: "PeerAsnListResult", + type: { + name: "Composite", + className: "PeerAsnListResult", + modelProperties: { + value: { + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "PeerAsn" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const PeeringLocationListResult: msRest.CompositeMapper = { + serializedName: "PeeringLocationListResult", + type: { + name: "Composite", + className: "PeeringLocationListResult", + modelProperties: { + value: { + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "PeeringLocation" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const PeeringServiceLocationListResult: msRest.CompositeMapper = { + serializedName: "PeeringServiceLocationListResult", + type: { + name: "Composite", + className: "PeeringServiceLocationListResult", + modelProperties: { + value: { + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "PeeringServiceLocation" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const PeeringServicePrefixListResult: msRest.CompositeMapper = { + serializedName: "PeeringServicePrefixListResult", + type: { + name: "Composite", + className: "PeeringServicePrefixListResult", + modelProperties: { + value: { + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "PeeringServicePrefix" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const PeeringServiceProviderListResult: msRest.CompositeMapper = { + serializedName: "PeeringServiceProviderListResult", + type: { + name: "Composite", + className: "PeeringServiceProviderListResult", + modelProperties: { + value: { + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "PeeringServiceProvider" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const PeeringServiceListResult: msRest.CompositeMapper = { + serializedName: "PeeringServiceListResult", + type: { + name: "Composite", + className: "PeeringServiceListResult", + modelProperties: { + value: { + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "PeeringService" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; diff --git a/sdk/peering/arm-peering/src/models/operationsMappers.ts b/sdk/peering/arm-peering/src/models/operationsMappers.ts new file mode 100644 index 000000000000..41b000418950 --- /dev/null +++ b/sdk/peering/arm-peering/src/models/operationsMappers.ts @@ -0,0 +1,14 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +export { + ErrorResponse, + Operation, + OperationDisplayInfo, + OperationListResult +} from "../models/mappers"; diff --git a/sdk/peering/arm-peering/src/models/parameters.ts b/sdk/peering/arm-peering/src/models/parameters.ts new file mode 100644 index 000000000000..e9e0cef438b5 --- /dev/null +++ b/sdk/peering/arm-peering/src/models/parameters.ts @@ -0,0 +1,135 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +import * as msRest from "@azure/ms-rest-js"; + +export const acceptLanguage: msRest.OperationParameter = { + parameterPath: "acceptLanguage", + mapper: { + serializedName: "accept-language", + defaultValue: 'en-US', + type: { + name: "String" + } + } +}; +export const apiVersion: msRest.OperationQueryParameter = { + parameterPath: "apiVersion", + mapper: { + required: true, + serializedName: "api-version", + type: { + name: "String" + } + } +}; +export const directPeeringType: msRest.OperationQueryParameter = { + parameterPath: [ + "options", + "directPeeringType" + ], + mapper: { + serializedName: "directPeeringType", + type: { + name: "String" + } + } +}; +export const kind: msRest.OperationQueryParameter = { + parameterPath: "kind", + mapper: { + required: true, + serializedName: "kind", + type: { + name: "String" + } + } +}; +export const nextPageLink: msRest.OperationURLParameter = { + parameterPath: "nextPageLink", + mapper: { + required: true, + serializedName: "nextLink", + type: { + name: "String" + } + }, + skipEncoding: true +}; +export const peerAsnName: msRest.OperationURLParameter = { + parameterPath: "peerAsnName", + mapper: { + required: true, + serializedName: "peerAsnName", + type: { + name: "String" + } + } +}; +export const peeringLocation: msRest.OperationQueryParameter = { + parameterPath: "peeringLocation", + mapper: { + required: true, + serializedName: "peeringLocation", + type: { + name: "String" + } + } +}; +export const peeringName: msRest.OperationURLParameter = { + parameterPath: "peeringName", + mapper: { + required: true, + serializedName: "peeringName", + type: { + name: "String" + } + } +}; +export const peeringServiceName: msRest.OperationURLParameter = { + parameterPath: "peeringServiceName", + mapper: { + required: true, + serializedName: "peeringServiceName", + type: { + name: "String" + } + } +}; +export const prefixName: msRest.OperationURLParameter = { + parameterPath: "prefixName", + mapper: { + required: true, + serializedName: "prefixName", + type: { + name: "String" + } + } +}; +export const resourceGroupName: msRest.OperationURLParameter = { + parameterPath: "resourceGroupName", + mapper: { + required: true, + serializedName: "resourceGroupName", + type: { + name: "String" + } + } +}; +export const subscriptionId: msRest.OperationURLParameter = { + parameterPath: "subscriptionId", + mapper: { + required: true, + serializedName: "subscriptionId", + type: { + name: "String" + } + } +}; diff --git a/sdk/peering/arm-peering/src/models/peerAsnsMappers.ts b/sdk/peering/arm-peering/src/models/peerAsnsMappers.ts new file mode 100644 index 000000000000..da3cdc4561cd --- /dev/null +++ b/sdk/peering/arm-peering/src/models/peerAsnsMappers.ts @@ -0,0 +1,34 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +export { + BaseResource, + BgpSession, + ContactInfo, + DirectConnection, + DirectPeeringFacility, + ErrorResponse, + ExchangeConnection, + ExchangePeeringFacility, + PeerAsn, + PeerAsnListResult, + Peering, + PeeringBandwidthOffer, + PeeringLocation, + PeeringLocationPropertiesDirect, + PeeringLocationPropertiesExchange, + PeeringPropertiesDirect, + PeeringPropertiesExchange, + PeeringService, + PeeringServiceLocation, + PeeringServicePrefix, + PeeringServiceProvider, + PeeringSku, + Resource, + SubResource +} from "../models/mappers"; diff --git a/sdk/peering/arm-peering/src/models/peeringLocationsMappers.ts b/sdk/peering/arm-peering/src/models/peeringLocationsMappers.ts new file mode 100644 index 000000000000..7e3205ea330a --- /dev/null +++ b/sdk/peering/arm-peering/src/models/peeringLocationsMappers.ts @@ -0,0 +1,34 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +export { + BaseResource, + BgpSession, + ContactInfo, + DirectConnection, + DirectPeeringFacility, + ErrorResponse, + ExchangeConnection, + ExchangePeeringFacility, + PeerAsn, + Peering, + PeeringBandwidthOffer, + PeeringLocation, + PeeringLocationListResult, + PeeringLocationPropertiesDirect, + PeeringLocationPropertiesExchange, + PeeringPropertiesDirect, + PeeringPropertiesExchange, + PeeringService, + PeeringServiceLocation, + PeeringServicePrefix, + PeeringServiceProvider, + PeeringSku, + Resource, + SubResource +} from "../models/mappers"; diff --git a/sdk/peering/arm-peering/src/models/peeringServiceLocationsMappers.ts b/sdk/peering/arm-peering/src/models/peeringServiceLocationsMappers.ts new file mode 100644 index 000000000000..c41b232f2c04 --- /dev/null +++ b/sdk/peering/arm-peering/src/models/peeringServiceLocationsMappers.ts @@ -0,0 +1,34 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +export { + BaseResource, + BgpSession, + ContactInfo, + DirectConnection, + DirectPeeringFacility, + ErrorResponse, + ExchangeConnection, + ExchangePeeringFacility, + PeerAsn, + Peering, + PeeringBandwidthOffer, + PeeringLocation, + PeeringLocationPropertiesDirect, + PeeringLocationPropertiesExchange, + PeeringPropertiesDirect, + PeeringPropertiesExchange, + PeeringService, + PeeringServiceLocation, + PeeringServiceLocationListResult, + PeeringServicePrefix, + PeeringServiceProvider, + PeeringSku, + Resource, + SubResource +} from "../models/mappers"; diff --git a/sdk/peering/arm-peering/src/models/peeringServicePrefixesMappers.ts b/sdk/peering/arm-peering/src/models/peeringServicePrefixesMappers.ts new file mode 100644 index 000000000000..3750ca36a206 --- /dev/null +++ b/sdk/peering/arm-peering/src/models/peeringServicePrefixesMappers.ts @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +export { + BaseResource, + BgpSession, + ContactInfo, + DirectConnection, + DirectPeeringFacility, + ErrorResponse, + ExchangeConnection, + ExchangePeeringFacility, + PeerAsn, + Peering, + PeeringBandwidthOffer, + PeeringLocation, + PeeringLocationPropertiesDirect, + PeeringLocationPropertiesExchange, + PeeringPropertiesDirect, + PeeringPropertiesExchange, + PeeringService, + PeeringServiceLocation, + PeeringServicePrefix, + PeeringServiceProvider, + PeeringSku, + Resource, + SubResource +} from "../models/mappers"; diff --git a/sdk/peering/arm-peering/src/models/peeringServiceProvidersMappers.ts b/sdk/peering/arm-peering/src/models/peeringServiceProvidersMappers.ts new file mode 100644 index 000000000000..b9729dc9379f --- /dev/null +++ b/sdk/peering/arm-peering/src/models/peeringServiceProvidersMappers.ts @@ -0,0 +1,34 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +export { + BaseResource, + BgpSession, + ContactInfo, + DirectConnection, + DirectPeeringFacility, + ErrorResponse, + ExchangeConnection, + ExchangePeeringFacility, + PeerAsn, + Peering, + PeeringBandwidthOffer, + PeeringLocation, + PeeringLocationPropertiesDirect, + PeeringLocationPropertiesExchange, + PeeringPropertiesDirect, + PeeringPropertiesExchange, + PeeringService, + PeeringServiceLocation, + PeeringServicePrefix, + PeeringServiceProvider, + PeeringServiceProviderListResult, + PeeringSku, + Resource, + SubResource +} from "../models/mappers"; diff --git a/sdk/peering/arm-peering/src/models/peeringServicesMappers.ts b/sdk/peering/arm-peering/src/models/peeringServicesMappers.ts new file mode 100644 index 000000000000..ddc9ffdfb198 --- /dev/null +++ b/sdk/peering/arm-peering/src/models/peeringServicesMappers.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +export { + BaseResource, + BgpSession, + ContactInfo, + DirectConnection, + DirectPeeringFacility, + ErrorResponse, + ExchangeConnection, + ExchangePeeringFacility, + PeerAsn, + Peering, + PeeringBandwidthOffer, + PeeringLocation, + PeeringLocationPropertiesDirect, + PeeringLocationPropertiesExchange, + PeeringPropertiesDirect, + PeeringPropertiesExchange, + PeeringService, + PeeringServiceListResult, + PeeringServiceLocation, + PeeringServicePrefix, + PeeringServiceProvider, + PeeringSku, + Resource, + ResourceTags, + SubResource +} from "../models/mappers"; diff --git a/sdk/peering/arm-peering/src/models/peeringsMappers.ts b/sdk/peering/arm-peering/src/models/peeringsMappers.ts new file mode 100644 index 000000000000..736ac14d0a85 --- /dev/null +++ b/sdk/peering/arm-peering/src/models/peeringsMappers.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +export { + BaseResource, + BgpSession, + ContactInfo, + DirectConnection, + DirectPeeringFacility, + ErrorResponse, + ExchangeConnection, + ExchangePeeringFacility, + PeerAsn, + Peering, + PeeringBandwidthOffer, + PeeringListResult, + PeeringLocation, + PeeringLocationPropertiesDirect, + PeeringLocationPropertiesExchange, + PeeringPropertiesDirect, + PeeringPropertiesExchange, + PeeringService, + PeeringServiceLocation, + PeeringServicePrefix, + PeeringServiceProvider, + PeeringSku, + Resource, + ResourceTags, + SubResource +} from "../models/mappers"; diff --git a/sdk/peering/arm-peering/src/models/prefixesMappers.ts b/sdk/peering/arm-peering/src/models/prefixesMappers.ts new file mode 100644 index 000000000000..880f11ef7879 --- /dev/null +++ b/sdk/peering/arm-peering/src/models/prefixesMappers.ts @@ -0,0 +1,34 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +export { + BaseResource, + BgpSession, + ContactInfo, + DirectConnection, + DirectPeeringFacility, + ErrorResponse, + ExchangeConnection, + ExchangePeeringFacility, + PeerAsn, + Peering, + PeeringBandwidthOffer, + PeeringLocation, + PeeringLocationPropertiesDirect, + PeeringLocationPropertiesExchange, + PeeringPropertiesDirect, + PeeringPropertiesExchange, + PeeringService, + PeeringServiceLocation, + PeeringServicePrefix, + PeeringServicePrefixListResult, + PeeringServiceProvider, + PeeringSku, + Resource, + SubResource +} from "../models/mappers"; diff --git a/sdk/peering/arm-peering/src/operations/index.ts b/sdk/peering/arm-peering/src/operations/index.ts new file mode 100644 index 000000000000..62dc0305012e --- /dev/null +++ b/sdk/peering/arm-peering/src/operations/index.ts @@ -0,0 +1,20 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +export * from "./legacyPeerings"; +export * from "./operations"; +export * from "./peerAsns"; +export * from "./peeringLocations"; +export * from "./peerings"; +export * from "./peeringServiceLocations"; +export * from "./peeringServicePrefixes"; +export * from "./prefixes"; +export * from "./peeringServiceProviders"; +export * from "./peeringServices"; diff --git a/sdk/peering/arm-peering/src/operations/legacyPeerings.ts b/sdk/peering/arm-peering/src/operations/legacyPeerings.ts new file mode 100644 index 000000000000..552e26a56c06 --- /dev/null +++ b/sdk/peering/arm-peering/src/operations/legacyPeerings.ts @@ -0,0 +1,138 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +import * as msRest from "@azure/ms-rest-js"; +import * as Models from "../models"; +import * as Mappers from "../models/legacyPeeringsMappers"; +import * as Parameters from "../models/parameters"; +import { PeeringManagementClientContext } from "../peeringManagementClientContext"; + +/** Class representing a LegacyPeerings. */ +export class LegacyPeerings { + private readonly client: PeeringManagementClientContext; + + /** + * Create a LegacyPeerings. + * @param {PeeringManagementClientContext} client Reference to the service client. + */ + constructor(client: PeeringManagementClientContext) { + this.client = client; + } + + /** + * Lists all of the legacy peerings under the given subscription matching the specified kind and + * location. + * @param peeringLocation The location of the peering. + * @param kind The kind of the peering. Possible values include: 'Direct', 'Exchange' + * @param [options] The optional parameters + * @returns Promise + */ + list(peeringLocation: string, kind: Models.Kind1, options?: msRest.RequestOptionsBase): Promise; + /** + * @param peeringLocation The location of the peering. + * @param kind The kind of the peering. Possible values include: 'Direct', 'Exchange' + * @param callback The callback + */ + list(peeringLocation: string, kind: Models.Kind1, callback: msRest.ServiceCallback): void; + /** + * @param peeringLocation The location of the peering. + * @param kind The kind of the peering. Possible values include: 'Direct', 'Exchange' + * @param options The optional parameters + * @param callback The callback + */ + list(peeringLocation: string, kind: Models.Kind1, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + list(peeringLocation: string, kind: Models.Kind1, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + peeringLocation, + kind, + options + }, + listOperationSpec, + callback) as Promise; + } + + /** + * Lists all of the legacy peerings under the given subscription matching the specified kind and + * location. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param options The optional parameters + * @param callback The callback + */ + listNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listNextOperationSpec, + callback) as Promise; + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const listOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/providers/Microsoft.Peering/legacyPeerings", + urlParameters: [ + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.peeringLocation, + Parameters.kind, + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.PeeringListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const listNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.PeeringListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; diff --git a/sdk/peering/arm-peering/src/operations/operations.ts b/sdk/peering/arm-peering/src/operations/operations.ts new file mode 100644 index 000000000000..ea8c2e65bb8d --- /dev/null +++ b/sdk/peering/arm-peering/src/operations/operations.ts @@ -0,0 +1,123 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +import * as msRest from "@azure/ms-rest-js"; +import * as Models from "../models"; +import * as Mappers from "../models/operationsMappers"; +import * as Parameters from "../models/parameters"; +import { PeeringManagementClientContext } from "../peeringManagementClientContext"; + +/** Class representing a Operations. */ +export class Operations { + private readonly client: PeeringManagementClientContext; + + /** + * Create a Operations. + * @param {PeeringManagementClientContext} client Reference to the service client. + */ + constructor(client: PeeringManagementClientContext) { + this.client = client; + } + + /** + * Lists all of the available API operations for peering resources. + * @param [options] The optional parameters + * @returns Promise + */ + list(options?: msRest.RequestOptionsBase): Promise; + /** + * @param callback The callback + */ + list(callback: msRest.ServiceCallback): void; + /** + * @param options The optional parameters + * @param callback The callback + */ + list(options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + list(options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + options + }, + listOperationSpec, + callback) as Promise; + } + + /** + * Lists all of the available API operations for peering resources. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param options The optional parameters + * @param callback The callback + */ + listNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listNextOperationSpec, + callback) as Promise; + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const listOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "providers/Microsoft.Peering/operations", + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.OperationListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const listNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.OperationListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; diff --git a/sdk/peering/arm-peering/src/operations/peerAsns.ts b/sdk/peering/arm-peering/src/operations/peerAsns.ts new file mode 100644 index 000000000000..c07c4c937eee --- /dev/null +++ b/sdk/peering/arm-peering/src/operations/peerAsns.ts @@ -0,0 +1,296 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +import * as msRest from "@azure/ms-rest-js"; +import * as Models from "../models"; +import * as Mappers from "../models/peerAsnsMappers"; +import * as Parameters from "../models/parameters"; +import { PeeringManagementClientContext } from "../peeringManagementClientContext"; + +/** Class representing a PeerAsns. */ +export class PeerAsns { + private readonly client: PeeringManagementClientContext; + + /** + * Create a PeerAsns. + * @param {PeeringManagementClientContext} client Reference to the service client. + */ + constructor(client: PeeringManagementClientContext) { + this.client = client; + } + + /** + * Gets the peer ASN with the specified name under the given subscription. + * @param peerAsnName The peer ASN name. + * @param [options] The optional parameters + * @returns Promise + */ + get(peerAsnName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param peerAsnName The peer ASN name. + * @param callback The callback + */ + get(peerAsnName: string, callback: msRest.ServiceCallback): void; + /** + * @param peerAsnName The peer ASN name. + * @param options The optional parameters + * @param callback The callback + */ + get(peerAsnName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + get(peerAsnName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + peerAsnName, + options + }, + getOperationSpec, + callback) as Promise; + } + + /** + * Creates a new peer ASN or updates an existing peer ASN with the specified name under the given + * subscription. + * @param peerAsnName The peer ASN name. + * @param peerAsn The peer ASN. + * @param [options] The optional parameters + * @returns Promise + */ + createOrUpdate(peerAsnName: string, peerAsn: Models.PeerAsn, options?: msRest.RequestOptionsBase): Promise; + /** + * @param peerAsnName The peer ASN name. + * @param peerAsn The peer ASN. + * @param callback The callback + */ + createOrUpdate(peerAsnName: string, peerAsn: Models.PeerAsn, callback: msRest.ServiceCallback): void; + /** + * @param peerAsnName The peer ASN name. + * @param peerAsn The peer ASN. + * @param options The optional parameters + * @param callback The callback + */ + createOrUpdate(peerAsnName: string, peerAsn: Models.PeerAsn, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + createOrUpdate(peerAsnName: string, peerAsn: Models.PeerAsn, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + peerAsnName, + peerAsn, + options + }, + createOrUpdateOperationSpec, + callback) as Promise; + } + + /** + * Deletes an existing peer ASN with the specified name under the given subscription. + * @param peerAsnName The peer ASN name. + * @param [options] The optional parameters + * @returns Promise + */ + deleteMethod(peerAsnName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param peerAsnName The peer ASN name. + * @param callback The callback + */ + deleteMethod(peerAsnName: string, callback: msRest.ServiceCallback): void; + /** + * @param peerAsnName The peer ASN name. + * @param options The optional parameters + * @param callback The callback + */ + deleteMethod(peerAsnName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + deleteMethod(peerAsnName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + peerAsnName, + options + }, + deleteMethodOperationSpec, + callback); + } + + /** + * Lists all of the peer ASNs under the given subscription. + * @param [options] The optional parameters + * @returns Promise + */ + listBySubscription(options?: msRest.RequestOptionsBase): Promise; + /** + * @param callback The callback + */ + listBySubscription(callback: msRest.ServiceCallback): void; + /** + * @param options The optional parameters + * @param callback The callback + */ + listBySubscription(options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listBySubscription(options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + options + }, + listBySubscriptionOperationSpec, + callback) as Promise; + } + + /** + * Lists all of the peer ASNs under the given subscription. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listBySubscriptionNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listBySubscriptionNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param options The optional parameters + * @param callback The callback + */ + listBySubscriptionNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listBySubscriptionNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listBySubscriptionNextOperationSpec, + callback) as Promise; + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const getOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/providers/Microsoft.Peering/peerAsns/{peerAsnName}", + urlParameters: [ + Parameters.peerAsnName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.PeerAsn + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const createOrUpdateOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "subscriptions/{subscriptionId}/providers/Microsoft.Peering/peerAsns/{peerAsnName}", + urlParameters: [ + Parameters.peerAsnName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "peerAsn", + mapper: { + ...Mappers.PeerAsn, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.PeerAsn + }, + 201: { + bodyMapper: Mappers.PeerAsn + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const deleteMethodOperationSpec: msRest.OperationSpec = { + httpMethod: "DELETE", + path: "subscriptions/{subscriptionId}/providers/Microsoft.Peering/peerAsns/{peerAsnName}", + urlParameters: [ + Parameters.peerAsnName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const listBySubscriptionOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/providers/Microsoft.Peering/peerAsns", + urlParameters: [ + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.PeerAsnListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const listBySubscriptionNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.PeerAsnListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; diff --git a/sdk/peering/arm-peering/src/operations/peeringLocations.ts b/sdk/peering/arm-peering/src/operations/peeringLocations.ts new file mode 100644 index 000000000000..759ff1c75516 --- /dev/null +++ b/sdk/peering/arm-peering/src/operations/peeringLocations.ts @@ -0,0 +1,132 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +import * as msRest from "@azure/ms-rest-js"; +import * as Models from "../models"; +import * as Mappers from "../models/peeringLocationsMappers"; +import * as Parameters from "../models/parameters"; +import { PeeringManagementClientContext } from "../peeringManagementClientContext"; + +/** Class representing a PeeringLocations. */ +export class PeeringLocations { + private readonly client: PeeringManagementClientContext; + + /** + * Create a PeeringLocations. + * @param {PeeringManagementClientContext} client Reference to the service client. + */ + constructor(client: PeeringManagementClientContext) { + this.client = client; + } + + /** + * Lists all of the available peering locations for the specified kind of peering. + * @param kind The kind of the peering. Possible values include: 'Direct', 'Exchange' + * @param [options] The optional parameters + * @returns Promise + */ + list(kind: Models.Kind2, options?: Models.PeeringLocationsListOptionalParams): Promise; + /** + * @param kind The kind of the peering. Possible values include: 'Direct', 'Exchange' + * @param callback The callback + */ + list(kind: Models.Kind2, callback: msRest.ServiceCallback): void; + /** + * @param kind The kind of the peering. Possible values include: 'Direct', 'Exchange' + * @param options The optional parameters + * @param callback The callback + */ + list(kind: Models.Kind2, options: Models.PeeringLocationsListOptionalParams, callback: msRest.ServiceCallback): void; + list(kind: Models.Kind2, options?: Models.PeeringLocationsListOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + kind, + options + }, + listOperationSpec, + callback) as Promise; + } + + /** + * Lists all of the available peering locations for the specified kind of peering. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param options The optional parameters + * @param callback The callback + */ + listNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listNextOperationSpec, + callback) as Promise; + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const listOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/providers/Microsoft.Peering/peeringLocations", + urlParameters: [ + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.kind, + Parameters.directPeeringType, + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.PeeringLocationListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const listNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.PeeringLocationListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; diff --git a/sdk/peering/arm-peering/src/operations/peeringServiceLocations.ts b/sdk/peering/arm-peering/src/operations/peeringServiceLocations.ts new file mode 100644 index 000000000000..dd0262656860 --- /dev/null +++ b/sdk/peering/arm-peering/src/operations/peeringServiceLocations.ts @@ -0,0 +1,126 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +import * as msRest from "@azure/ms-rest-js"; +import * as Models from "../models"; +import * as Mappers from "../models/peeringServiceLocationsMappers"; +import * as Parameters from "../models/parameters"; +import { PeeringManagementClientContext } from "../peeringManagementClientContext"; + +/** Class representing a PeeringServiceLocations. */ +export class PeeringServiceLocations { + private readonly client: PeeringManagementClientContext; + + /** + * Create a PeeringServiceLocations. + * @param {PeeringManagementClientContext} client Reference to the service client. + */ + constructor(client: PeeringManagementClientContext) { + this.client = client; + } + + /** + * Lists all of the available peering service locations for the specified kind of peering. + * @param [options] The optional parameters + * @returns Promise + */ + list(options?: msRest.RequestOptionsBase): Promise; + /** + * @param callback The callback + */ + list(callback: msRest.ServiceCallback): void; + /** + * @param options The optional parameters + * @param callback The callback + */ + list(options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + list(options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + options + }, + listOperationSpec, + callback) as Promise; + } + + /** + * Lists all of the available peering service locations for the specified kind of peering. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param options The optional parameters + * @param callback The callback + */ + listNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listNextOperationSpec, + callback) as Promise; + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const listOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/providers/Microsoft.Peering/peeringServiceLocations", + urlParameters: [ + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.PeeringServiceLocationListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const listNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.PeeringServiceLocationListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; diff --git a/sdk/peering/arm-peering/src/operations/peeringServicePrefixes.ts b/sdk/peering/arm-peering/src/operations/peeringServicePrefixes.ts new file mode 100644 index 000000000000..be55a7d444d9 --- /dev/null +++ b/sdk/peering/arm-peering/src/operations/peeringServicePrefixes.ts @@ -0,0 +1,229 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +import * as msRest from "@azure/ms-rest-js"; +import * as Models from "../models"; +import * as Mappers from "../models/peeringServicePrefixesMappers"; +import * as Parameters from "../models/parameters"; +import { PeeringManagementClientContext } from "../peeringManagementClientContext"; + +/** Class representing a PeeringServicePrefixes. */ +export class PeeringServicePrefixes { + private readonly client: PeeringManagementClientContext; + + /** + * Create a PeeringServicePrefixes. + * @param {PeeringManagementClientContext} client Reference to the service client. + */ + constructor(client: PeeringManagementClientContext) { + this.client = client; + } + + /** + * Gets the peering service prefix. + * @param resourceGroupName The resource group name. + * @param peeringServiceName The peering service name. + * @param prefixName The prefix name. + * @param [options] The optional parameters + * @returns Promise + */ + get(resourceGroupName: string, peeringServiceName: string, prefixName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The resource group name. + * @param peeringServiceName The peering service name. + * @param prefixName The prefix name. + * @param callback The callback + */ + get(resourceGroupName: string, peeringServiceName: string, prefixName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The resource group name. + * @param peeringServiceName The peering service name. + * @param prefixName The prefix name. + * @param options The optional parameters + * @param callback The callback + */ + get(resourceGroupName: string, peeringServiceName: string, prefixName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + get(resourceGroupName: string, peeringServiceName: string, prefixName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + peeringServiceName, + prefixName, + options + }, + getOperationSpec, + callback) as Promise; + } + + /** + * Creates or updates the peering prefix. + * @param resourceGroupName The resource group name. + * @param peeringServiceName The peering service name. + * @param prefixName The prefix name + * @param peeringServicePrefix The IP prefix for an peering + * @param [options] The optional parameters + * @returns Promise + */ + createOrUpdate(resourceGroupName: string, peeringServiceName: string, prefixName: string, peeringServicePrefix: Models.PeeringServicePrefix, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The resource group name. + * @param peeringServiceName The peering service name. + * @param prefixName The prefix name + * @param peeringServicePrefix The IP prefix for an peering + * @param callback The callback + */ + createOrUpdate(resourceGroupName: string, peeringServiceName: string, prefixName: string, peeringServicePrefix: Models.PeeringServicePrefix, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The resource group name. + * @param peeringServiceName The peering service name. + * @param prefixName The prefix name + * @param peeringServicePrefix The IP prefix for an peering + * @param options The optional parameters + * @param callback The callback + */ + createOrUpdate(resourceGroupName: string, peeringServiceName: string, prefixName: string, peeringServicePrefix: Models.PeeringServicePrefix, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + createOrUpdate(resourceGroupName: string, peeringServiceName: string, prefixName: string, peeringServicePrefix: Models.PeeringServicePrefix, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + peeringServiceName, + prefixName, + peeringServicePrefix, + options + }, + createOrUpdateOperationSpec, + callback) as Promise; + } + + /** + * removes the peering prefix. + * @param resourceGroupName The resource group name. + * @param peeringServiceName The peering service name. + * @param prefixName The prefix name + * @param [options] The optional parameters + * @returns Promise + */ + deleteMethod(resourceGroupName: string, peeringServiceName: string, prefixName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The resource group name. + * @param peeringServiceName The peering service name. + * @param prefixName The prefix name + * @param callback The callback + */ + deleteMethod(resourceGroupName: string, peeringServiceName: string, prefixName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The resource group name. + * @param peeringServiceName The peering service name. + * @param prefixName The prefix name + * @param options The optional parameters + * @param callback The callback + */ + deleteMethod(resourceGroupName: string, peeringServiceName: string, prefixName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + deleteMethod(resourceGroupName: string, peeringServiceName: string, prefixName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + peeringServiceName, + prefixName, + options + }, + deleteMethodOperationSpec, + callback); + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const getOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Peering/peeringServices/{peeringServiceName}/prefixes/{prefixName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.peeringServiceName, + Parameters.prefixName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.PeeringServicePrefix + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const createOrUpdateOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Peering/peeringServices/{peeringServiceName}/prefixes/{prefixName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.peeringServiceName, + Parameters.prefixName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "peeringServicePrefix", + mapper: { + ...Mappers.PeeringServicePrefix, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.PeeringServicePrefix + }, + 201: { + bodyMapper: Mappers.PeeringServicePrefix + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const deleteMethodOperationSpec: msRest.OperationSpec = { + httpMethod: "DELETE", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Peering/peeringServices/{peeringServiceName}/prefixes/{prefixName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.peeringServiceName, + Parameters.prefixName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; diff --git a/sdk/peering/arm-peering/src/operations/peeringServiceProviders.ts b/sdk/peering/arm-peering/src/operations/peeringServiceProviders.ts new file mode 100644 index 000000000000..edbad85b30c6 --- /dev/null +++ b/sdk/peering/arm-peering/src/operations/peeringServiceProviders.ts @@ -0,0 +1,126 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +import * as msRest from "@azure/ms-rest-js"; +import * as Models from "../models"; +import * as Mappers from "../models/peeringServiceProvidersMappers"; +import * as Parameters from "../models/parameters"; +import { PeeringManagementClientContext } from "../peeringManagementClientContext"; + +/** Class representing a PeeringServiceProviders. */ +export class PeeringServiceProviders { + private readonly client: PeeringManagementClientContext; + + /** + * Create a PeeringServiceProviders. + * @param {PeeringManagementClientContext} client Reference to the service client. + */ + constructor(client: PeeringManagementClientContext) { + this.client = client; + } + + /** + * Lists all of the available peering service locations for the specified kind of peering. + * @param [options] The optional parameters + * @returns Promise + */ + list(options?: msRest.RequestOptionsBase): Promise; + /** + * @param callback The callback + */ + list(callback: msRest.ServiceCallback): void; + /** + * @param options The optional parameters + * @param callback The callback + */ + list(options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + list(options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + options + }, + listOperationSpec, + callback) as Promise; + } + + /** + * Lists all of the available peering service locations for the specified kind of peering. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param options The optional parameters + * @param callback The callback + */ + listNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listNextOperationSpec, + callback) as Promise; + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const listOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/providers/Microsoft.Peering/peeringServiceProviders", + urlParameters: [ + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.PeeringServiceProviderListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const listNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.PeeringServiceProviderListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; diff --git a/sdk/peering/arm-peering/src/operations/peeringServices.ts b/sdk/peering/arm-peering/src/operations/peeringServices.ts new file mode 100644 index 000000000000..46b91d13e22d --- /dev/null +++ b/sdk/peering/arm-peering/src/operations/peeringServices.ts @@ -0,0 +1,484 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +import * as msRest from "@azure/ms-rest-js"; +import * as Models from "../models"; +import * as Mappers from "../models/peeringServicesMappers"; +import * as Parameters from "../models/parameters"; +import { PeeringManagementClientContext } from "../peeringManagementClientContext"; + +/** Class representing a PeeringServices. */ +export class PeeringServices { + private readonly client: PeeringManagementClientContext; + + /** + * Create a PeeringServices. + * @param {PeeringManagementClientContext} client Reference to the service client. + */ + constructor(client: PeeringManagementClientContext) { + this.client = client; + } + + /** + * Gets an existing peering service with the specified name under the given subscription and + * resource group. + * @param resourceGroupName The name of the resource group. + * @param peeringServiceName The name of the peering. + * @param [options] The optional parameters + * @returns Promise + */ + get(resourceGroupName: string, peeringServiceName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group. + * @param peeringServiceName The name of the peering. + * @param callback The callback + */ + get(resourceGroupName: string, peeringServiceName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group. + * @param peeringServiceName The name of the peering. + * @param options The optional parameters + * @param callback The callback + */ + get(resourceGroupName: string, peeringServiceName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + get(resourceGroupName: string, peeringServiceName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + peeringServiceName, + options + }, + getOperationSpec, + callback) as Promise; + } + + /** + * Creates a new peering service or updates an existing peering with the specified name under the + * given subscription and resource group. + * @param resourceGroupName The name of the resource group. + * @param peeringServiceName The name of the peering service. + * @param peeringService The properties needed to create or update a peering service. + * @param [options] The optional parameters + * @returns Promise + */ + createOrUpdate(resourceGroupName: string, peeringServiceName: string, peeringService: Models.PeeringService, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group. + * @param peeringServiceName The name of the peering service. + * @param peeringService The properties needed to create or update a peering service. + * @param callback The callback + */ + createOrUpdate(resourceGroupName: string, peeringServiceName: string, peeringService: Models.PeeringService, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group. + * @param peeringServiceName The name of the peering service. + * @param peeringService The properties needed to create or update a peering service. + * @param options The optional parameters + * @param callback The callback + */ + createOrUpdate(resourceGroupName: string, peeringServiceName: string, peeringService: Models.PeeringService, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + createOrUpdate(resourceGroupName: string, peeringServiceName: string, peeringService: Models.PeeringService, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + peeringServiceName, + peeringService, + options + }, + createOrUpdateOperationSpec, + callback) as Promise; + } + + /** + * Deletes an existing peering service with the specified name under the given subscription and + * resource group. + * @param resourceGroupName The name of the resource group. + * @param peeringServiceName The name of the peering service. + * @param [options] The optional parameters + * @returns Promise + */ + deleteMethod(resourceGroupName: string, peeringServiceName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group. + * @param peeringServiceName The name of the peering service. + * @param callback The callback + */ + deleteMethod(resourceGroupName: string, peeringServiceName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group. + * @param peeringServiceName The name of the peering service. + * @param options The optional parameters + * @param callback The callback + */ + deleteMethod(resourceGroupName: string, peeringServiceName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + deleteMethod(resourceGroupName: string, peeringServiceName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + peeringServiceName, + options + }, + deleteMethodOperationSpec, + callback); + } + + /** + * Updates tags for a peering service with the specified name under the given subscription and + * resource group. + * @param resourceGroupName The name of the resource group. + * @param peeringServiceName The name of the peering service. + * @param [options] The optional parameters + * @returns Promise + */ + update(resourceGroupName: string, peeringServiceName: string, options?: Models.PeeringServicesUpdateOptionalParams): Promise; + /** + * @param resourceGroupName The name of the resource group. + * @param peeringServiceName The name of the peering service. + * @param callback The callback + */ + update(resourceGroupName: string, peeringServiceName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group. + * @param peeringServiceName The name of the peering service. + * @param options The optional parameters + * @param callback The callback + */ + update(resourceGroupName: string, peeringServiceName: string, options: Models.PeeringServicesUpdateOptionalParams, callback: msRest.ServiceCallback): void; + update(resourceGroupName: string, peeringServiceName: string, options?: Models.PeeringServicesUpdateOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + peeringServiceName, + options + }, + updateOperationSpec, + callback) as Promise; + } + + /** + * Lists all of the peering services under the given subscription and resource group. + * @param resourceGroupName The name of the resource group. + * @param [options] The optional parameters + * @returns Promise + */ + listByResourceGroup(resourceGroupName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group. + * @param callback The callback + */ + listByResourceGroup(resourceGroupName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group. + * @param options The optional parameters + * @param callback The callback + */ + listByResourceGroup(resourceGroupName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listByResourceGroup(resourceGroupName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + options + }, + listByResourceGroupOperationSpec, + callback) as Promise; + } + + /** + * Lists all of the peerings under the given subscription. + * @param [options] The optional parameters + * @returns Promise + */ + listBySubscription(options?: msRest.RequestOptionsBase): Promise; + /** + * @param callback The callback + */ + listBySubscription(callback: msRest.ServiceCallback): void; + /** + * @param options The optional parameters + * @param callback The callback + */ + listBySubscription(options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listBySubscription(options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + options + }, + listBySubscriptionOperationSpec, + callback) as Promise; + } + + /** + * Lists all of the peering services under the given subscription and resource group. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listByResourceGroupNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listByResourceGroupNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param options The optional parameters + * @param callback The callback + */ + listByResourceGroupNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listByResourceGroupNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listByResourceGroupNextOperationSpec, + callback) as Promise; + } + + /** + * Lists all of the peerings under the given subscription. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listBySubscriptionNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listBySubscriptionNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param options The optional parameters + * @param callback The callback + */ + listBySubscriptionNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listBySubscriptionNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listBySubscriptionNextOperationSpec, + callback) as Promise; + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const getOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Peering/peeringServices/{peeringServiceName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.peeringServiceName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.PeeringService + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const createOrUpdateOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Peering/peeringServices/{peeringServiceName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.peeringServiceName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "peeringService", + mapper: { + ...Mappers.PeeringService, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.PeeringService + }, + 201: { + bodyMapper: Mappers.PeeringService + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const deleteMethodOperationSpec: msRest.OperationSpec = { + httpMethod: "DELETE", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Peering/peeringServices/{peeringServiceName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.peeringServiceName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const updateOperationSpec: msRest.OperationSpec = { + httpMethod: "PATCH", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Peering/peeringServices/{peeringServiceName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.peeringServiceName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: { + tags: [ + "options", + "tags" + ] + }, + mapper: { + ...Mappers.ResourceTags, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.PeeringService + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const listByResourceGroupOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Peering/peeringServices", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.PeeringServiceListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const listBySubscriptionOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/providers/Microsoft.Peering/peeringServices", + urlParameters: [ + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.PeeringServiceListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const listByResourceGroupNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.PeeringServiceListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const listBySubscriptionNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.PeeringServiceListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; diff --git a/sdk/peering/arm-peering/src/operations/peerings.ts b/sdk/peering/arm-peering/src/operations/peerings.ts new file mode 100644 index 000000000000..5ae8d6aac042 --- /dev/null +++ b/sdk/peering/arm-peering/src/operations/peerings.ts @@ -0,0 +1,484 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +import * as msRest from "@azure/ms-rest-js"; +import * as Models from "../models"; +import * as Mappers from "../models/peeringsMappers"; +import * as Parameters from "../models/parameters"; +import { PeeringManagementClientContext } from "../peeringManagementClientContext"; + +/** Class representing a Peerings. */ +export class Peerings { + private readonly client: PeeringManagementClientContext; + + /** + * Create a Peerings. + * @param {PeeringManagementClientContext} client Reference to the service client. + */ + constructor(client: PeeringManagementClientContext) { + this.client = client; + } + + /** + * Gets an existing peering with the specified name under the given subscription and resource + * group. + * @param resourceGroupName The name of the resource group. + * @param peeringName The name of the peering. + * @param [options] The optional parameters + * @returns Promise + */ + get(resourceGroupName: string, peeringName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group. + * @param peeringName The name of the peering. + * @param callback The callback + */ + get(resourceGroupName: string, peeringName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group. + * @param peeringName The name of the peering. + * @param options The optional parameters + * @param callback The callback + */ + get(resourceGroupName: string, peeringName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + get(resourceGroupName: string, peeringName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + peeringName, + options + }, + getOperationSpec, + callback) as Promise; + } + + /** + * Creates a new peering or updates an existing peering with the specified name under the given + * subscription and resource group. + * @param resourceGroupName The name of the resource group. + * @param peeringName The name of the peering. + * @param peering The properties needed to create or update a peering. + * @param [options] The optional parameters + * @returns Promise + */ + createOrUpdate(resourceGroupName: string, peeringName: string, peering: Models.Peering, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group. + * @param peeringName The name of the peering. + * @param peering The properties needed to create or update a peering. + * @param callback The callback + */ + createOrUpdate(resourceGroupName: string, peeringName: string, peering: Models.Peering, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group. + * @param peeringName The name of the peering. + * @param peering The properties needed to create or update a peering. + * @param options The optional parameters + * @param callback The callback + */ + createOrUpdate(resourceGroupName: string, peeringName: string, peering: Models.Peering, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + createOrUpdate(resourceGroupName: string, peeringName: string, peering: Models.Peering, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + peeringName, + peering, + options + }, + createOrUpdateOperationSpec, + callback) as Promise; + } + + /** + * Deletes an existing peering with the specified name under the given subscription and resource + * group. + * @param resourceGroupName The name of the resource group. + * @param peeringName The name of the peering. + * @param [options] The optional parameters + * @returns Promise + */ + deleteMethod(resourceGroupName: string, peeringName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group. + * @param peeringName The name of the peering. + * @param callback The callback + */ + deleteMethod(resourceGroupName: string, peeringName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group. + * @param peeringName The name of the peering. + * @param options The optional parameters + * @param callback The callback + */ + deleteMethod(resourceGroupName: string, peeringName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + deleteMethod(resourceGroupName: string, peeringName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + peeringName, + options + }, + deleteMethodOperationSpec, + callback); + } + + /** + * Updates tags for a peering with the specified name under the given subscription and resource + * group. + * @param resourceGroupName The name of the resource group. + * @param peeringName The name of the peering. + * @param [options] The optional parameters + * @returns Promise + */ + update(resourceGroupName: string, peeringName: string, options?: Models.PeeringsUpdateOptionalParams): Promise; + /** + * @param resourceGroupName The name of the resource group. + * @param peeringName The name of the peering. + * @param callback The callback + */ + update(resourceGroupName: string, peeringName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group. + * @param peeringName The name of the peering. + * @param options The optional parameters + * @param callback The callback + */ + update(resourceGroupName: string, peeringName: string, options: Models.PeeringsUpdateOptionalParams, callback: msRest.ServiceCallback): void; + update(resourceGroupName: string, peeringName: string, options?: Models.PeeringsUpdateOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + peeringName, + options + }, + updateOperationSpec, + callback) as Promise; + } + + /** + * Lists all of the peerings under the given subscription and resource group. + * @param resourceGroupName The name of the resource group. + * @param [options] The optional parameters + * @returns Promise + */ + listByResourceGroup(resourceGroupName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group. + * @param callback The callback + */ + listByResourceGroup(resourceGroupName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group. + * @param options The optional parameters + * @param callback The callback + */ + listByResourceGroup(resourceGroupName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listByResourceGroup(resourceGroupName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + options + }, + listByResourceGroupOperationSpec, + callback) as Promise; + } + + /** + * Lists all of the peerings under the given subscription. + * @param [options] The optional parameters + * @returns Promise + */ + listBySubscription(options?: msRest.RequestOptionsBase): Promise; + /** + * @param callback The callback + */ + listBySubscription(callback: msRest.ServiceCallback): void; + /** + * @param options The optional parameters + * @param callback The callback + */ + listBySubscription(options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listBySubscription(options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + options + }, + listBySubscriptionOperationSpec, + callback) as Promise; + } + + /** + * Lists all of the peerings under the given subscription and resource group. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listByResourceGroupNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listByResourceGroupNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param options The optional parameters + * @param callback The callback + */ + listByResourceGroupNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listByResourceGroupNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listByResourceGroupNextOperationSpec, + callback) as Promise; + } + + /** + * Lists all of the peerings under the given subscription. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listBySubscriptionNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listBySubscriptionNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param options The optional parameters + * @param callback The callback + */ + listBySubscriptionNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listBySubscriptionNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listBySubscriptionNextOperationSpec, + callback) as Promise; + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const getOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Peering/peerings/{peeringName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.peeringName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.Peering + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const createOrUpdateOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Peering/peerings/{peeringName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.peeringName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "peering", + mapper: { + ...Mappers.Peering, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.Peering + }, + 201: { + bodyMapper: Mappers.Peering + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const deleteMethodOperationSpec: msRest.OperationSpec = { + httpMethod: "DELETE", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Peering/peerings/{peeringName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.peeringName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const updateOperationSpec: msRest.OperationSpec = { + httpMethod: "PATCH", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Peering/peerings/{peeringName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.peeringName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: { + tags: [ + "options", + "tags" + ] + }, + mapper: { + ...Mappers.ResourceTags, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.Peering + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const listByResourceGroupOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Peering/peerings", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.PeeringListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const listBySubscriptionOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/providers/Microsoft.Peering/peerings", + urlParameters: [ + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.PeeringListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const listByResourceGroupNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.PeeringListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const listBySubscriptionNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.PeeringListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; diff --git a/sdk/peering/arm-peering/src/operations/prefixes.ts b/sdk/peering/arm-peering/src/operations/prefixes.ts new file mode 100644 index 000000000000..ae39a7f70bce --- /dev/null +++ b/sdk/peering/arm-peering/src/operations/prefixes.ts @@ -0,0 +1,136 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +import * as msRest from "@azure/ms-rest-js"; +import * as Models from "../models"; +import * as Mappers from "../models/prefixesMappers"; +import * as Parameters from "../models/parameters"; +import { PeeringManagementClientContext } from "../peeringManagementClientContext"; + +/** Class representing a Prefixes. */ +export class Prefixes { + private readonly client: PeeringManagementClientContext; + + /** + * Create a Prefixes. + * @param {PeeringManagementClientContext} client Reference to the service client. + */ + constructor(client: PeeringManagementClientContext) { + this.client = client; + } + + /** + * Lists the peerings prefix in the resource group. + * @param resourceGroupName The resource group name. + * @param peeringServiceName The peering service name. + * @param [options] The optional parameters + * @returns Promise + */ + listByPeeringService(resourceGroupName: string, peeringServiceName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The resource group name. + * @param peeringServiceName The peering service name. + * @param callback The callback + */ + listByPeeringService(resourceGroupName: string, peeringServiceName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The resource group name. + * @param peeringServiceName The peering service name. + * @param options The optional parameters + * @param callback The callback + */ + listByPeeringService(resourceGroupName: string, peeringServiceName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listByPeeringService(resourceGroupName: string, peeringServiceName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + peeringServiceName, + options + }, + listByPeeringServiceOperationSpec, + callback) as Promise; + } + + /** + * Lists the peerings prefix in the resource group. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listByPeeringServiceNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listByPeeringServiceNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param options The optional parameters + * @param callback The callback + */ + listByPeeringServiceNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listByPeeringServiceNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listByPeeringServiceNextOperationSpec, + callback) as Promise; + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const listByPeeringServiceOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Peering/peeringServices/{peeringServiceName}/prefixes", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.peeringServiceName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.PeeringServicePrefixListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const listByPeeringServiceNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.PeeringServicePrefixListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; diff --git a/sdk/peering/arm-peering/src/peeringManagementClient.ts b/sdk/peering/arm-peering/src/peeringManagementClient.ts new file mode 100644 index 000000000000..bacf9dc4aabe --- /dev/null +++ b/sdk/peering/arm-peering/src/peeringManagementClient.ts @@ -0,0 +1,129 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +import * as msRest from "@azure/ms-rest-js"; +import * as Models from "./models"; +import * as Mappers from "./models/mappers"; +import * as Parameters from "./models/parameters"; +import * as operations from "./operations"; +import { PeeringManagementClientContext } from "./peeringManagementClientContext"; + + +class PeeringManagementClient extends PeeringManagementClientContext { + // Operation groups + legacyPeerings: operations.LegacyPeerings; + operations: operations.Operations; + peerAsns: operations.PeerAsns; + peeringLocations: operations.PeeringLocations; + peerings: operations.Peerings; + peeringServiceLocations: operations.PeeringServiceLocations; + peeringServicePrefixes: operations.PeeringServicePrefixes; + prefixes: operations.Prefixes; + peeringServiceProviders: operations.PeeringServiceProviders; + peeringServices: operations.PeeringServices; + + /** + * Initializes a new instance of the PeeringManagementClient class. + * @param credentials Credentials needed for the client to connect to Azure. + * @param subscriptionId The Azure subscription ID. + * @param [options] The parameter options + */ + constructor(credentials: msRest.ServiceClientCredentials, subscriptionId: string, options?: Models.PeeringManagementClientOptions) { + super(credentials, subscriptionId, options); + this.legacyPeerings = new operations.LegacyPeerings(this); + this.operations = new operations.Operations(this); + this.peerAsns = new operations.PeerAsns(this); + this.peeringLocations = new operations.PeeringLocations(this); + this.peerings = new operations.Peerings(this); + this.peeringServiceLocations = new operations.PeeringServiceLocations(this); + this.peeringServicePrefixes = new operations.PeeringServicePrefixes(this); + this.prefixes = new operations.Prefixes(this); + this.peeringServiceProviders = new operations.PeeringServiceProviders(this); + this.peeringServices = new operations.PeeringServices(this); + } + + /** + * Checks if the peering service provider is present within 1000 miles of customer's location + * @param [options] The optional parameters + * @returns Promise + */ + checkServiceProviderAvailability(options?: Models.PeeringManagementClientCheckServiceProviderAvailabilityOptionalParams): Promise; + /** + * @param callback The callback + */ + checkServiceProviderAvailability(callback: msRest.ServiceCallback): void; + /** + * @param options The optional parameters + * @param callback The callback + */ + checkServiceProviderAvailability(options: Models.PeeringManagementClientCheckServiceProviderAvailabilityOptionalParams, callback: msRest.ServiceCallback): void; + checkServiceProviderAvailability(options?: Models.PeeringManagementClientCheckServiceProviderAvailabilityOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.sendOperationRequest( + { + options + }, + checkServiceProviderAvailabilityOperationSpec, + callback) as Promise; + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const checkServiceProviderAvailabilityOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/providers/Microsoft.Peering/CheckServiceProviderAvailability", + urlParameters: [ + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: { + peeringServiceLocation: [ + "options", + "peeringServiceLocation" + ], + peeringServiceProvider: [ + "options", + "peeringServiceProvider" + ] + }, + mapper: { + ...Mappers.CheckServiceProviderAvailabilityInput, + required: true + } + }, + responses: { + 200: { + bodyMapper: { + serializedName: "parsedResponse", + type: { + name: "String" + } + } + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +export { + PeeringManagementClient, + PeeringManagementClientContext, + Models as PeeringManagementModels, + Mappers as PeeringManagementMappers +}; +export * from "./operations"; diff --git a/sdk/peering/arm-peering/src/peeringManagementClientContext.ts b/sdk/peering/arm-peering/src/peeringManagementClientContext.ts new file mode 100644 index 000000000000..33fd6ae85bd7 --- /dev/null +++ b/sdk/peering/arm-peering/src/peeringManagementClientContext.ts @@ -0,0 +1,62 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +import * as Models from "./models"; +import * as msRest from "@azure/ms-rest-js"; +import * as msRestAzure from "@azure/ms-rest-azure-js"; + +const packageName = "@azure/arm-peering"; +const packageVersion = "1.0.0"; + +export class PeeringManagementClientContext extends msRestAzure.AzureServiceClient { + credentials: msRest.ServiceClientCredentials; + subscriptionId: string; + apiVersion?: string; + + /** + * Initializes a new instance of the PeeringManagementClient class. + * @param credentials Credentials needed for the client to connect to Azure. + * @param subscriptionId The Azure subscription ID. + * @param [options] The parameter options + */ + constructor(credentials: msRest.ServiceClientCredentials, subscriptionId: string, options?: Models.PeeringManagementClientOptions) { + if (credentials == undefined) { + throw new Error('\'credentials\' cannot be null.'); + } + if (subscriptionId == undefined) { + throw new Error('\'subscriptionId\' cannot be null.'); + } + + if (!options) { + options = {}; + } + if(!options.userAgent) { + const defaultUserAgent = msRestAzure.getDefaultUserAgentValue(); + options.userAgent = `${packageName}/${packageVersion} ${defaultUserAgent}`; + } + + super(credentials, options); + + this.apiVersion = '2019-08-01-preview'; + this.acceptLanguage = 'en-US'; + this.longRunningOperationRetryTimeout = 30; + this.baseUri = options.baseUri || this.baseUri || "https://management.azure.com"; + this.requestContentType = "application/json; charset=utf-8"; + this.credentials = credentials; + this.subscriptionId = subscriptionId; + + if(options.acceptLanguage !== null && options.acceptLanguage !== undefined) { + this.acceptLanguage = options.acceptLanguage; + } + if(options.longRunningOperationRetryTimeout !== null && options.longRunningOperationRetryTimeout !== undefined) { + this.longRunningOperationRetryTimeout = options.longRunningOperationRetryTimeout; + } + } +} diff --git a/sdk/peering/arm-peering/tsconfig.json b/sdk/peering/arm-peering/tsconfig.json new file mode 100644 index 000000000000..422b584abd5e --- /dev/null +++ b/sdk/peering/arm-peering/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "module": "es6", + "moduleResolution": "node", + "strict": true, + "target": "es5", + "sourceMap": true, + "declarationMap": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "forceConsistentCasingInFileNames": true, + "lib": ["es6", "dom"], + "declaration": true, + "outDir": "./esm", + "importHelpers": true + }, + "include": ["./src/**/*.ts"], + "exclude": ["node_modules"] +}