diff --git a/lib/services/networkManagement2/lib/models/expressRouteCircuit.js b/lib/services/networkManagement2/lib/models/expressRouteCircuit.js index fe3414539f..17f558401f 100644 --- a/lib/services/networkManagement2/lib/models/expressRouteCircuit.js +++ b/lib/services/networkManagement2/lib/models/expressRouteCircuit.js @@ -62,6 +62,8 @@ class ExpressRouteCircuit extends models['Resource'] { * @property {string} [gatewayManagerEtag] The GatewayManager Etag. * @property {boolean} [allowGlobalReach] Flag to enable Global Reach on the * circuit. + * @property {boolean} [globalReachEnabled] Flag denoting Global reach + * status. * @property {string} [etag] Gets a unique read-only string that changes * whenever the resource is updated. */ @@ -252,6 +254,13 @@ class ExpressRouteCircuit extends models['Resource'] { name: 'Boolean' } }, + globalReachEnabled: { + required: false, + serializedName: 'properties.globalReachEnabled', + type: { + name: 'Boolean' + } + }, etag: { required: false, readOnly: true, diff --git a/lib/services/networkManagement2/lib/models/expressRouteCircuitPeering.js b/lib/services/networkManagement2/lib/models/expressRouteCircuitPeering.js index 3c02f9ef76..5dc1a576b3 100644 --- a/lib/services/networkManagement2/lib/models/expressRouteCircuitPeering.js +++ b/lib/services/networkManagement2/lib/models/expressRouteCircuitPeering.js @@ -117,6 +117,8 @@ class ExpressRouteCircuitPeering extends models['SubResource'] { * ExpressRouteConnection. * @property {array} [connections] The list of circuit connections associated * with Azure Private Peering for this circuit. + * @property {array} [peeredConnections] The list of peered circuit + * connections associated with Azure Private Peering for this circuit. * @property {string} [name] Gets name of the resource that is unique within * a resource group. This name can be used to access the resource. * @property {string} [etag] A unique read-only string that changes whenever @@ -297,6 +299,22 @@ class ExpressRouteCircuitPeering extends models['SubResource'] { } } }, + peeredConnections: { + required: false, + readOnly: true, + serializedName: 'properties.peeredConnections', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'PeerExpressRouteCircuitConnectionElementType', + type: { + name: 'Composite', + className: 'PeerExpressRouteCircuitConnection' + } + } + } + }, name: { required: false, serializedName: 'name', diff --git a/lib/services/networkManagement2/lib/models/index.d.ts b/lib/services/networkManagement2/lib/models/index.d.ts index 779f817d12..401043a570 100644 --- a/lib/services/networkManagement2/lib/models/index.d.ts +++ b/lib/services/networkManagement2/lib/models/index.d.ts @@ -2996,6 +2996,51 @@ export interface ExpressRouteCircuitConnection extends SubResource { readonly etag?: string; } +/** + * Peer Express Route Circuit Connection in an ExpressRouteCircuitPeering resource. +*/ +export interface PeerExpressRouteCircuitConnection extends SubResource { + /** + * Reference to Express Route Circuit Private Peering Resource of the circuit. + */ + expressRouteCircuitPeering?: SubResource; + /** + * Reference to Express Route Circuit Private Peering Resource of the peered circuit. + */ + peerExpressRouteCircuitPeering?: SubResource; + /** + * /29 IP address space to carve out Customer addresses for tunnels. + */ + addressPrefix?: string; + /** + * Express Route Circuit Connection State. Possible values are: 'Connected' and 'Disconnected'. + * Possible values include: 'Connected', 'Connecting', 'Disconnected' + */ + readonly circuitConnectionStatus?: string; + /** + * The name of the express route circuit connection resource. + */ + connectionName?: string; + /** + * The resource guid of the authorization used for the express route circuit connection. + */ + authResourceGuid?: string; + /** + * Provisioning state of the peer express route circuit connection resource. Possible values are: + * 'Succeeded', 'Updating', 'Deleting', and 'Failed'. + */ + readonly provisioningState?: string; + /** + * Gets name of the resource that is unique within a resource group. This name can be used to + * access the resource. + */ + name?: string; + /** + * A unique read-only string that changes whenever the resource is updated. + */ + readonly etag?: string; +} + /** * Peering in an ExpressRouteCircuit resource. */ @@ -3078,6 +3123,10 @@ export interface ExpressRouteCircuitPeering extends SubResource { * The list of circuit connections associated with Azure Private Peering for this circuit. */ connections?: ExpressRouteCircuitConnection[]; + /** + * The list of peered circuit connections associated with Azure Private Peering for this circuit. + */ + readonly peeredConnections?: PeerExpressRouteCircuitConnection[]; /** * Gets name of the resource that is unique within a resource group. This name can be used to * access the resource. @@ -3245,6 +3294,10 @@ export interface ExpressRouteCircuit extends Resource { * Flag to enable Global Reach on the circuit. */ allowGlobalReach?: boolean; + /** + * Flag denoting Global reach status. + */ + globalReachEnabled?: boolean; /** * Gets a unique read-only string that changes whenever the resource is updated. */ @@ -7784,6 +7837,18 @@ Array { nextLink?: string; } +/** + * Response for ListPeeredConnections API service call retrieves all global reach peer circuit + * connections that belongs to a Private Peering for an ExpressRouteCircuit. +*/ +export interface PeerExpressRouteCircuitConnectionListResult extends +Array { + /** + * The URL to get the next set of results. + */ + nextLink?: string; +} + /** * Response for ListExpressRouteCircuit API service call. */ diff --git a/lib/services/networkManagement2/lib/models/index.js b/lib/services/networkManagement2/lib/models/index.js index 796a019f0d..ab2ab4510f 100644 --- a/lib/services/networkManagement2/lib/models/index.js +++ b/lib/services/networkManagement2/lib/models/index.js @@ -118,6 +118,7 @@ exports.RouteFilterRule = require('./routeFilterRule'); exports.ExpressRouteCircuitStats = require('./expressRouteCircuitStats'); exports.ExpressRouteConnectionId = require('./expressRouteConnectionId'); exports.ExpressRouteCircuitConnection = require('./expressRouteCircuitConnection'); +exports.PeerExpressRouteCircuitConnection = require('./peerExpressRouteCircuitConnection'); exports.ExpressRouteCircuitPeering = require('./expressRouteCircuitPeering'); exports.RouteFilter = require('./routeFilter'); exports.Ipv6ExpressRouteCircuitPeeringConfig = require('./ipv6ExpressRouteCircuitPeeringConfig'); @@ -315,6 +316,7 @@ exports.EndpointServicesListResult = require('./endpointServicesListResult'); exports.AuthorizationListResult = require('./authorizationListResult'); exports.ExpressRouteCircuitPeeringListResult = require('./expressRouteCircuitPeeringListResult'); exports.ExpressRouteCircuitConnectionListResult = require('./expressRouteCircuitConnectionListResult'); +exports.PeerExpressRouteCircuitConnectionListResult = require('./peerExpressRouteCircuitConnectionListResult'); exports.ExpressRouteCircuitListResult = require('./expressRouteCircuitListResult'); exports.ExpressRouteServiceProviderListResult = require('./expressRouteServiceProviderListResult'); exports.ExpressRouteCrossConnectionListResult = require('./expressRouteCrossConnectionListResult'); diff --git a/lib/services/networkManagement2/lib/models/peerExpressRouteCircuitConnection.js b/lib/services/networkManagement2/lib/models/peerExpressRouteCircuitConnection.js new file mode 100644 index 0000000000..a946b7287e --- /dev/null +++ b/lib/services/networkManagement2/lib/models/peerExpressRouteCircuitConnection.js @@ -0,0 +1,146 @@ +/* + * 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. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Peer Express Route Circuit Connection in an ExpressRouteCircuitPeering + * resource. + * + * @extends models['SubResource'] + */ +class PeerExpressRouteCircuitConnection extends models['SubResource'] { + /** + * Create a PeerExpressRouteCircuitConnection. + * @property {object} [expressRouteCircuitPeering] Reference to Express Route + * Circuit Private Peering Resource of the circuit. + * @property {string} [expressRouteCircuitPeering.id] Resource ID. + * @property {object} [peerExpressRouteCircuitPeering] Reference to Express + * Route Circuit Private Peering Resource of the peered circuit. + * @property {string} [peerExpressRouteCircuitPeering.id] Resource ID. + * @property {string} [addressPrefix] /29 IP address space to carve out + * Customer addresses for tunnels. + * @property {string} [circuitConnectionStatus] Express Route Circuit + * Connection State. Possible values are: 'Connected' and 'Disconnected'. + * Possible values include: 'Connected', 'Connecting', 'Disconnected' + * @property {string} [connectionName] The name of the express route circuit + * connection resource. + * @property {string} [authResourceGuid] The resource guid of the + * authorization used for the express route circuit connection. + * @property {string} [provisioningState] Provisioning state of the peer + * express route circuit connection resource. Possible values are: + * 'Succeeded', 'Updating', 'Deleting', and 'Failed'. + * @property {string} [name] Gets name of the resource that is unique within + * a resource group. This name can be used to access the resource. + * @property {string} [etag] A unique read-only string that changes whenever + * the resource is updated. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of PeerExpressRouteCircuitConnection + * + * @returns {object} metadata of PeerExpressRouteCircuitConnection + * + */ + mapper() { + return { + required: false, + serializedName: 'PeerExpressRouteCircuitConnection', + type: { + name: 'Composite', + className: 'PeerExpressRouteCircuitConnection', + modelProperties: { + id: { + required: false, + serializedName: 'id', + type: { + name: 'String' + } + }, + expressRouteCircuitPeering: { + required: false, + serializedName: 'properties.expressRouteCircuitPeering', + type: { + name: 'Composite', + className: 'SubResource' + } + }, + peerExpressRouteCircuitPeering: { + required: false, + serializedName: 'properties.peerExpressRouteCircuitPeering', + type: { + name: 'Composite', + className: 'SubResource' + } + }, + addressPrefix: { + required: false, + serializedName: 'properties.addressPrefix', + type: { + name: 'String' + } + }, + circuitConnectionStatus: { + required: false, + readOnly: true, + serializedName: 'properties.circuitConnectionStatus', + type: { + name: 'String' + } + }, + connectionName: { + required: false, + serializedName: 'properties.connectionName', + type: { + name: 'String' + } + }, + authResourceGuid: { + required: false, + serializedName: 'properties.authResourceGuid', + type: { + name: 'String' + } + }, + provisioningState: { + required: false, + readOnly: true, + serializedName: 'properties.provisioningState', + type: { + name: 'String' + } + }, + name: { + required: false, + serializedName: 'name', + type: { + name: 'String' + } + }, + etag: { + required: false, + readOnly: true, + serializedName: 'etag', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = PeerExpressRouteCircuitConnection; diff --git a/lib/services/networkManagement2/lib/models/peerExpressRouteCircuitConnectionListResult.js b/lib/services/networkManagement2/lib/models/peerExpressRouteCircuitConnectionListResult.js new file mode 100644 index 0000000000..455667b48f --- /dev/null +++ b/lib/services/networkManagement2/lib/models/peerExpressRouteCircuitConnectionListResult.js @@ -0,0 +1,69 @@ +/* + * 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. + */ + +'use strict'; + +/** + * Response for ListPeeredConnections API service call retrieves all global + * reach peer circuit connections that belongs to a Private Peering for an + * ExpressRouteCircuit. + */ +class PeerExpressRouteCircuitConnectionListResult extends Array { + /** + * Create a PeerExpressRouteCircuitConnectionListResult. + * @property {string} [nextLink] The URL to get the next set of results. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of PeerExpressRouteCircuitConnectionListResult + * + * @returns {object} metadata of PeerExpressRouteCircuitConnectionListResult + * + */ + mapper() { + return { + required: false, + serializedName: 'PeerExpressRouteCircuitConnectionListResult', + type: { + name: 'Composite', + className: 'PeerExpressRouteCircuitConnectionListResult', + modelProperties: { + value: { + required: false, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'PeerExpressRouteCircuitConnectionElementType', + type: { + name: 'Composite', + className: 'PeerExpressRouteCircuitConnection' + } + } + } + }, + nextLink: { + required: false, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = PeerExpressRouteCircuitConnectionListResult; diff --git a/lib/services/networkManagement2/lib/networkManagementClient.d.ts b/lib/services/networkManagement2/lib/networkManagementClient.d.ts index 6a549fc30e..2465f27de0 100644 --- a/lib/services/networkManagement2/lib/networkManagementClient.d.ts +++ b/lib/services/networkManagement2/lib/networkManagementClient.d.ts @@ -66,6 +66,7 @@ export default class NetworkManagementClient extends AzureServiceClient { expressRouteCircuitAuthorizations: operations.ExpressRouteCircuitAuthorizations; expressRouteCircuitPeerings: operations.ExpressRouteCircuitPeerings; expressRouteCircuitConnections: operations.ExpressRouteCircuitConnections; + peerExpressRouteCircuitConnections: operations.PeerExpressRouteCircuitConnections; expressRouteCircuits: operations.ExpressRouteCircuits; expressRouteServiceProviders: operations.ExpressRouteServiceProviders; expressRouteCrossConnections: operations.ExpressRouteCrossConnections; diff --git a/lib/services/networkManagement2/lib/networkManagementClient.js b/lib/services/networkManagement2/lib/networkManagementClient.js index ad0b9330d3..19e66eb80f 100644 --- a/lib/services/networkManagement2/lib/networkManagementClient.js +++ b/lib/services/networkManagement2/lib/networkManagementClient.js @@ -376,6 +376,7 @@ class NetworkManagementClient extends ServiceClient { this.expressRouteCircuitAuthorizations = new operations.ExpressRouteCircuitAuthorizations(this); this.expressRouteCircuitPeerings = new operations.ExpressRouteCircuitPeerings(this); this.expressRouteCircuitConnections = new operations.ExpressRouteCircuitConnections(this); + this.peerExpressRouteCircuitConnections = new operations.PeerExpressRouteCircuitConnections(this); this.expressRouteCircuits = new operations.ExpressRouteCircuits(this); this.expressRouteServiceProviders = new operations.ExpressRouteServiceProviders(this); this.expressRouteCrossConnections = new operations.ExpressRouteCrossConnections(this); diff --git a/lib/services/networkManagement2/lib/operations/expressRouteCircuits.js b/lib/services/networkManagement2/lib/operations/expressRouteCircuits.js index 186aaec386..5d9a0e63ab 100644 --- a/lib/services/networkManagement2/lib/operations/expressRouteCircuits.js +++ b/lib/services/networkManagement2/lib/operations/expressRouteCircuits.js @@ -293,6 +293,9 @@ function _get(resourceGroupName, circuitName, options, callback) { * @param {boolean} [parameters.allowGlobalReach] Flag to enable Global Reach * on the circuit. * + * @param {boolean} [parameters.globalReachEnabled] Flag denoting Global reach + * status. + * * @param {string} [parameters.id] Resource ID. * * @param {string} [parameters.location] Resource location. @@ -1466,6 +1469,9 @@ function _beginDeleteMethod(resourceGroupName, circuitName, options, callback) { * @param {boolean} [parameters.allowGlobalReach] Flag to enable Global Reach * on the circuit. * + * @param {boolean} [parameters.globalReachEnabled] Flag denoting Global reach + * status. + * * @param {string} [parameters.id] Resource ID. * * @param {string} [parameters.location] Resource location. @@ -2807,6 +2813,9 @@ class ExpressRouteCircuits { * @param {boolean} [parameters.allowGlobalReach] Flag to enable Global Reach * on the circuit. * + * @param {boolean} [parameters.globalReachEnabled] Flag denoting Global reach + * status. + * * @param {string} [parameters.id] Resource ID. * * @param {string} [parameters.location] Resource location. @@ -2910,6 +2919,9 @@ class ExpressRouteCircuits { * @param {boolean} [parameters.allowGlobalReach] Flag to enable Global Reach * on the circuit. * + * @param {boolean} [parameters.globalReachEnabled] Flag denoting Global reach + * status. + * * @param {string} [parameters.id] Resource ID. * * @param {string} [parameters.location] Resource location. @@ -3848,6 +3860,9 @@ class ExpressRouteCircuits { * @param {boolean} [parameters.allowGlobalReach] Flag to enable Global Reach * on the circuit. * + * @param {boolean} [parameters.globalReachEnabled] Flag denoting Global reach + * status. + * * @param {string} [parameters.id] Resource ID. * * @param {string} [parameters.location] Resource location. @@ -3951,6 +3966,9 @@ class ExpressRouteCircuits { * @param {boolean} [parameters.allowGlobalReach] Flag to enable Global Reach * on the circuit. * + * @param {boolean} [parameters.globalReachEnabled] Flag denoting Global reach + * status. + * * @param {string} [parameters.id] Resource ID. * * @param {string} [parameters.location] Resource location. diff --git a/lib/services/networkManagement2/lib/operations/index.d.ts b/lib/services/networkManagement2/lib/operations/index.d.ts index 61ae5217ca..7768ffe2fc 100644 --- a/lib/services/networkManagement2/lib/operations/index.d.ts +++ b/lib/services/networkManagement2/lib/operations/index.d.ts @@ -7151,6 +7151,213 @@ export interface ExpressRouteCircuitConnections { listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; } +/** + * @class + * PeerExpressRouteCircuitConnections + * __NOTE__: An instance of this class is automatically created for an + * instance of the NetworkManagementClient. + */ +export interface PeerExpressRouteCircuitConnections { + + + /** + * Gets the specified Peer Express Route Circuit Connection from the specified + * express route circuit. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of the express route circuit. + * + * @param {string} peeringName The name of the peering. + * + * @param {string} connectionName The name of the peer express route circuit + * connection. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getWithHttpOperationResponse(resourceGroupName: string, circuitName: string, peeringName: string, connectionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets the specified Peer Express Route Circuit Connection from the specified + * express route circuit. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of the express route circuit. + * + * @param {string} peeringName The name of the peering. + * + * @param {string} connectionName The name of the peer express route circuit + * connection. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {PeerExpressRouteCircuitConnection} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {PeerExpressRouteCircuitConnection} [result] - The deserialized result object if an error did not occur. + * See {@link PeerExpressRouteCircuitConnection} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + get(resourceGroupName: string, circuitName: string, peeringName: string, connectionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, circuitName: string, peeringName: string, connectionName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, circuitName: string, peeringName: string, connectionName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets all global reach peer connections associated with a private peering in + * an express route circuit. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of the circuit. + * + * @param {string} peeringName The name of the peering. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listWithHttpOperationResponse(resourceGroupName: string, circuitName: string, peeringName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets all global reach peer connections associated with a private peering in + * an express route circuit. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of the circuit. + * + * @param {string} peeringName The name of the peering. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {PeerExpressRouteCircuitConnectionListResult} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {PeerExpressRouteCircuitConnectionListResult} [result] - The deserialized result object if an error did not occur. + * See {@link PeerExpressRouteCircuitConnectionListResult} + * for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + list(resourceGroupName: string, circuitName: string, peeringName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(resourceGroupName: string, circuitName: string, peeringName: string, callback: ServiceCallback): void; + list(resourceGroupName: string, circuitName: string, peeringName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets all global reach peer connections associated with a private peering in + * an express route circuit. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets all global reach peer connections associated with a private peering in + * an express route circuit. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {PeerExpressRouteCircuitConnectionListResult} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {PeerExpressRouteCircuitConnectionListResult} [result] - The deserialized result object if an error did not occur. + * See {@link PeerExpressRouteCircuitConnectionListResult} + * for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listNext(nextPageLink: string, callback: ServiceCallback): void; + listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + /** * @class * ExpressRouteCircuits @@ -7349,6 +7556,9 @@ export interface ExpressRouteCircuits { * @param {boolean} [parameters.allowGlobalReach] Flag to enable Global Reach * on the circuit. * + * @param {boolean} [parameters.globalReachEnabled] Flag denoting Global reach + * status. + * * @param {string} [parameters.id] Resource ID. * * @param {string} [parameters.location] Resource location. @@ -7440,6 +7650,9 @@ export interface ExpressRouteCircuits { * @param {boolean} [parameters.allowGlobalReach] Flag to enable Global Reach * on the circuit. * + * @param {boolean} [parameters.globalReachEnabled] Flag denoting Global reach + * status. + * * @param {string} [parameters.id] Resource ID. * * @param {string} [parameters.location] Resource location. @@ -8120,6 +8333,9 @@ export interface ExpressRouteCircuits { * @param {boolean} [parameters.allowGlobalReach] Flag to enable Global Reach * on the circuit. * + * @param {boolean} [parameters.globalReachEnabled] Flag denoting Global reach + * status. + * * @param {string} [parameters.id] Resource ID. * * @param {string} [parameters.location] Resource location. @@ -8211,6 +8427,9 @@ export interface ExpressRouteCircuits { * @param {boolean} [parameters.allowGlobalReach] Flag to enable Global Reach * on the circuit. * + * @param {boolean} [parameters.globalReachEnabled] Flag denoting Global reach + * status. + * * @param {string} [parameters.id] Resource ID. * * @param {string} [parameters.location] Resource location. diff --git a/lib/services/networkManagement2/lib/operations/index.js b/lib/services/networkManagement2/lib/operations/index.js index 694db4c1c5..fff2f861a3 100644 --- a/lib/services/networkManagement2/lib/operations/index.js +++ b/lib/services/networkManagement2/lib/operations/index.js @@ -26,6 +26,7 @@ exports.AvailableEndpointServices = require('./availableEndpointServices'); exports.ExpressRouteCircuitAuthorizations = require('./expressRouteCircuitAuthorizations'); exports.ExpressRouteCircuitPeerings = require('./expressRouteCircuitPeerings'); exports.ExpressRouteCircuitConnections = require('./expressRouteCircuitConnections'); +exports.PeerExpressRouteCircuitConnections = require('./peerExpressRouteCircuitConnections'); exports.ExpressRouteCircuits = require('./expressRouteCircuits'); exports.ExpressRouteServiceProviders = require('./expressRouteServiceProviders'); exports.ExpressRouteCrossConnections = require('./expressRouteCrossConnections'); diff --git a/lib/services/networkManagement2/lib/operations/peerExpressRouteCircuitConnections.js b/lib/services/networkManagement2/lib/operations/peerExpressRouteCircuitConnections.js new file mode 100644 index 0000000000..83fa806779 --- /dev/null +++ b/lib/services/networkManagement2/lib/operations/peerExpressRouteCircuitConnections.js @@ -0,0 +1,749 @@ +/* + * 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. + */ + +'use strict'; + +const msRest = require('ms-rest'); +const msRestAzure = require('ms-rest-azure'); +const WebResource = msRest.WebResource; + +/** + * Gets the specified Peer Express Route Circuit Connection from the specified + * express route circuit. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of the express route circuit. + * + * @param {string} peeringName The name of the peering. + * + * @param {string} connectionName The name of the peer express route circuit + * connection. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link PeerExpressRouteCircuitConnection} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _get(resourceGroupName, circuitName, peeringName, connectionName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2018-12-01'; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (circuitName === null || circuitName === undefined || typeof circuitName.valueOf() !== 'string') { + throw new Error('circuitName cannot be null or undefined and it must be of type string.'); + } + if (peeringName === null || peeringName === undefined || typeof peeringName.valueOf() !== 'string') { + throw new Error('peeringName cannot be null or undefined and it must be of type string.'); + } + if (connectionName === null || connectionName === undefined || typeof connectionName.valueOf() !== 'string') { + throw new Error('connectionName cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/peerConnections/{connectionName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{circuitName}', encodeURIComponent(circuitName)); + requestUrl = requestUrl.replace('{peeringName}', encodeURIComponent(peeringName)); + requestUrl = requestUrl.replace('{connectionName}', encodeURIComponent(connectionName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['PeerExpressRouteCircuitConnection']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Gets all global reach peer connections associated with a private peering in + * an express route circuit. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of the circuit. + * + * @param {string} peeringName The name of the peering. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link PeerExpressRouteCircuitConnectionListResult} + * for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _list(resourceGroupName, circuitName, peeringName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2018-12-01'; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (circuitName === null || circuitName === undefined || typeof circuitName.valueOf() !== 'string') { + throw new Error('circuitName cannot be null or undefined and it must be of type string.'); + } + if (peeringName === null || peeringName === undefined || typeof peeringName.valueOf() !== 'string') { + throw new Error('peeringName cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/peerConnections'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{circuitName}', encodeURIComponent(circuitName)); + requestUrl = requestUrl.replace('{peeringName}', encodeURIComponent(peeringName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['PeerExpressRouteCircuitConnectionListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Gets all global reach peer connections associated with a private peering in + * an express route circuit. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link PeerExpressRouteCircuitConnectionListResult} + * for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listNext(nextPageLink, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { + throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let requestUrl = '{nextLink}'; + requestUrl = requestUrl.replace('{nextLink}', nextPageLink); + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['PeerExpressRouteCircuitConnectionListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** Class representing a PeerExpressRouteCircuitConnections. */ +class PeerExpressRouteCircuitConnections { + /** + * Create a PeerExpressRouteCircuitConnections. + * @param {NetworkManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._get = _get; + this._list = _list; + this._listNext = _listNext; + } + + /** + * Gets the specified Peer Express Route Circuit Connection from the specified + * express route circuit. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of the express route circuit. + * + * @param {string} peeringName The name of the peering. + * + * @param {string} connectionName The name of the peer express route circuit + * connection. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getWithHttpOperationResponse(resourceGroupName, circuitName, peeringName, connectionName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._get(resourceGroupName, circuitName, peeringName, connectionName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets the specified Peer Express Route Circuit Connection from the specified + * express route circuit. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of the express route circuit. + * + * @param {string} peeringName The name of the peering. + * + * @param {string} connectionName The name of the peer express route circuit + * connection. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {PeerExpressRouteCircuitConnection} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link PeerExpressRouteCircuitConnection} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + get(resourceGroupName, circuitName, peeringName, connectionName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._get(resourceGroupName, circuitName, peeringName, connectionName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._get(resourceGroupName, circuitName, peeringName, connectionName, options, optionalCallback); + } + } + + /** + * Gets all global reach peer connections associated with a private peering in + * an express route circuit. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of the circuit. + * + * @param {string} peeringName The name of the peering. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listWithHttpOperationResponse(resourceGroupName, circuitName, peeringName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._list(resourceGroupName, circuitName, peeringName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets all global reach peer connections associated with a private peering in + * an express route circuit. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of the circuit. + * + * @param {string} peeringName The name of the peering. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {PeerExpressRouteCircuitConnectionListResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link PeerExpressRouteCircuitConnectionListResult} + * for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + list(resourceGroupName, circuitName, peeringName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._list(resourceGroupName, circuitName, peeringName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._list(resourceGroupName, circuitName, peeringName, options, optionalCallback); + } + } + + /** + * Gets all global reach peer connections associated with a private peering in + * an express route circuit. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets all global reach peer connections associated with a private peering in + * an express route circuit. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {PeerExpressRouteCircuitConnectionListResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link PeerExpressRouteCircuitConnectionListResult} + * for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listNext(nextPageLink, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listNext(nextPageLink, options, optionalCallback); + } + } + +} + +module.exports = PeerExpressRouteCircuitConnections;